| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | import cn.hutool.http.HttpUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueAuth; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.Custom; |
| | | import com.yuanchu.mom.dto.UserPageDto; |
| | | import com.yuanchu.mom.pojo.User; |
| | | import com.yuanchu.mom.service.CustomService; |
| | | import com.yuanchu.mom.service.PowerService; |
| | | import com.yuanchu.mom.service.UserService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.utils.RedisUtil; |
| | | import com.yuanchu.mom.utils.ServletUtils; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.DigestUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | private PowerService powerService; |
| | | |
| | | private Jwt jwt; |
| | | |
| | | private CustomService customService; |
| | | |
| | | @ApiOperation(value = "登录") |
| | | @PostMapping("/enter") |
| | |
| | | return Result.success(userService.addUser(user)); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取用户信息枚举") |
| | | @GetMapping("/getUserMenu") |
| | | @ValueAuth |
| | | public Result<?> getUserMenu() { |
| | | return Result.success(userService.getUserMenu()); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取客户列表") |
| | | @PostMapping("/selectCustomPageList") |
| | | public Result selectCustomPageList(@RequestBody Map<String, Object> data) throws Exception { |
| | | Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class); |
| | | Custom custom = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), Custom.class); |
| | | return Result.success(customService.selectCustomPageList(page, custom)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除客户信息") |
| | | @PostMapping("/delCustomById") |
| | | public Result<?> delCustomById(Integer id) { |
| | | return Result.success(customService.delCustomById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增客户信息") |
| | | @PostMapping("/addCustom") |
| | | public Result<?> addCustom(@RequestBody Custom custom) { |
| | | return Result.success(customService.addCustom(custom)); |
| | | } |
| | | |
| | | //获取设备负责人 |
| | | @ValueAuth |
| | | @ApiOperation(value = "获取设备负责人") |
| | | @GetMapping("/getDeviceManager") |
| | | public Result<?> getDeviceManager() { |
| | | return Result.success(userService.getDeviceManager()); |
| | | } |
| | | |
| | | } |