|
|
@@ -0,0 +1,56 @@
|
|
|
+package cn.tr.module.smart.web.controller;
|
|
|
+
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import cn.tr.core.validation.Insert;
|
|
|
+import cn.tr.core.pojo.CommonResult;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import cn.tr.module.smart.common.dto.BizAvatarDTO;
|
|
|
+import cn.tr.module.smart.common.service.IBizAvatarService;
|
|
|
+import cn.tr.module.smart.common.dto.BizAvatarQueryDTO;
|
|
|
+import java.util.*;
|
|
|
+import cn.tr.plugin.mybatis.base.BaseController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+/**
|
|
|
+ * 头像控制器
|
|
|
+ *
|
|
|
+ * @author lf
|
|
|
+ * @date 2025/09/01 11:36
|
|
|
+ */
|
|
|
+@Api(tags = "头像管理")
|
|
|
+@RestController
|
|
|
+@RequestMapping("/web/avatar")
|
|
|
+@AllArgsConstructor
|
|
|
+public class BizAvatarController extends BaseController{
|
|
|
+
|
|
|
+ private final IBizAvatarService bizAvatarService;
|
|
|
+
|
|
|
+ @ApiOperationSupport(author = "lf",order = 1)
|
|
|
+ @ApiOperation(value="根据条件查询头像(不分页)",notes = "权限: 无")
|
|
|
+ @PostMapping("/query/list")
|
|
|
+ public CommonResult<List<BizAvatarDTO>> selectList(@RequestBody@Validated BizAvatarQueryDTO query) {
|
|
|
+ return CommonResult.success(bizAvatarService.selectBizAvatarList(query));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(author = "lf",order = 2)
|
|
|
+ @ApiOperation(value="添加头像",notes = "权限: common:avatar:add")
|
|
|
+ @PostMapping("/add")
|
|
|
+ @SaCheckPermission("common:avatar:add")
|
|
|
+ public CommonResult<Boolean> add(@RequestBody@Validated(Insert.class) BizAvatarDTO source) {
|
|
|
+ return CommonResult.success(bizAvatarService.insertBizAvatar(source));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperationSupport(author = "lf",order = 3)
|
|
|
+ @ApiOperation(value="删除头像",notes = "权限: common:avatar:remove")
|
|
|
+ @PostMapping("/removeByIds")
|
|
|
+ @SaCheckPermission("common:avatar:remove")
|
|
|
+ public CommonResult<Integer> delete(@RequestBody Collection<String> ids) {
|
|
|
+ return CommonResult.success(bizAvatarService.removeBizAvatarByIds(ids));
|
|
|
+ }
|
|
|
+}
|