| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.dto.TagListQueryDto; |
| | | import com.ruoyi.account.api.dto.UnitListQueryDto; |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserTag; |
| | | import com.ruoyi.account.service.TAppUserTagService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-app-user-tag") |
| | | public class TAppUserTagController { |
| | | @Resource |
| | | private OtherClient otherClient; |
| | | @Resource |
| | | private TAppUserTagService appUserTagService; |
| | | |
| | | @ApiOperation(value = "标签管理列表", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/page") |
| | | public R<Page<TUserTag>> tagPage(@RequestBody TagListQueryDto tagListQueryDto) { |
| | | //拿到单位列表 |
| | | R<Page<TUserTag>> pageR = otherClient.queryTagPage(tagListQueryDto); |
| | | Page<TUserTag> data = pageR.getData(); |
| | | //拿到单位的用户数 |
| | | for (TUserTag record : data.getRecords()) { |
| | | record.setCount(appUserTagService.lambdaQuery().eq(TAppUserTag::getUserTagId, record.getId()).count()); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "标签添加或修改", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/add") |
| | | public R<Page<TUserTag>> tagAdd(@RequestBody TUserTag tUserTag) { |
| | | //拿到单位列表 |
| | | otherClient.addorUpdateTag(tUserTag); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "标签删除", tags = {"用户管理-用户标签管理"}) |
| | | @PostMapping(value = "/tags/delete/{id}") |
| | | public R delete(@PathVariable Integer id) { |
| | | //拿到单位列表 |
| | | otherClient.deleteTag(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |