| | |
| | | package com.moral.api.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.moral.api.pojo.ext.allocation.AllocationPageExt; |
| | | import com.moral.api.pojo.query.app.AppAllocationFileCond; |
| | | import com.moral.api.pojo.query.app.AppAllocationPageCond; |
| | | import com.moral.api.pojo.vo.app.AppAllocationFindVo; |
| | | import com.moral.api.pojo.vo.app.AppAuthority; |
| | | import com.moral.constant.PageResult; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | return ResultMessage.ok(ObjectUtils.isEmpty(allocationFindVos)? "0":allocationFindVos); |
| | | } |
| | | |
| | | @PostMapping("/page") |
| | | @ApiOperation("小程序分页查询") |
| | | public ResultMessage<PageResult<AppAllocationFindVo>> page(@Valid @RequestBody AppAllocationPageCond allocationPageCond){ |
| | | Page<AllocationPageExt> allocationFindVos = allocationService.pageApp(allocationPageCond); |
| | | PageResult<AppAllocationFindVo> result = new PageResult<>(allocationFindVos); |
| | | result.setList(AppAllocationFindVo.convert(allocationFindVos.getRecords())); |
| | | return ResultMessage.ok(result); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | List<String> list = Arrays.asList("aaa", "bbb","aaa"); |
| | | System.out.println("num;" + Collections.frequency(list, "aaa")); |
| | | } |
| | | |
| | | @PostMapping("appFile") |
| | | @ApiOperation("用户头像新增or修改") |
| | | public ResultMessage appFile(@Valid @RequestBody AppAllocationFileCond appAllocationFileCond){ |
| | | allocationService.saveFile(appAllocationFileCond); |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | | @PostMapping("changeRoutine") |
| | | @ApiOperation("小程序整改") |
| | |
| | | return ResultMessage.ok(); |
| | | } |
| | | |
| | | |
| | | @GetMapping("authority") |
| | | @ApiOperation(value = "分享权限") |
| | | public ResultMessage authority(@RequestParam @ApiParam(value = "allocationNum",name = "单号") String allocationNum, |
| | | @RequestParam @ApiParam(value = "userId",name = "用户Id") Integer userId){ |
| | | AppAuthority authority = allocationService.authority(allocationNum, userId); |
| | | return ResultMessage.ok(authority); |
| | | } |
| | | |
| | | } |