包工头消息
This commit is contained in:
@ -0,0 +1,108 @@
|
||||
package com.ruoyi.web.controller.bgt;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.ruoyi.bgt.domain.BgtMessage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.bgt.bo.BgtMessageQueryBo;
|
||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* 消息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-25
|
||||
*/
|
||||
@Api(value = "消息控制器", tags = {"消息管理"})
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/bgt/message")
|
||||
public class BgtMessageController extends BaseController {
|
||||
|
||||
private final IBgtMessageService iBgtMessageService;
|
||||
|
||||
/**
|
||||
* 查询消息列表
|
||||
*/
|
||||
@ApiOperation("查询消息列表")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BgtMessage> list(@Validated BgtMessageQueryBo bo) {
|
||||
return iBgtMessageService.queryPageList(bo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出消息列表
|
||||
*/
|
||||
@ApiOperation("导出消息列表")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:export')")
|
||||
@Log(title = "消息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult<BgtMessage> export(@Validated BgtMessageQueryBo bo) {
|
||||
List<BgtMessage> list = iBgtMessageService.queryList(bo);
|
||||
ExcelUtil<BgtMessage> util = new ExcelUtil<BgtMessage>(BgtMessage.class);
|
||||
return util.exportExcel(list, "消息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取消息详细信息
|
||||
*/
|
||||
@ApiOperation("获取消息详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:query')")
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult<BgtMessage> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(iBgtMessageService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增消息
|
||||
*/
|
||||
@ApiOperation("新增消息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:add')")
|
||||
@Log(title = "消息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public AjaxResult<Void> add(@Validated @RequestBody BgtMessage bo) {
|
||||
return toAjax(iBgtMessageService.insert(bo) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改消息
|
||||
*/
|
||||
@ApiOperation("修改消息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:edit')")
|
||||
@Log(title = "消息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit
|
||||
@PutMapping()
|
||||
public AjaxResult<Void> edit(@Validated @RequestBody BgtMessage bo) {
|
||||
return toAjax(iBgtMessageService.update(bo) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
*/
|
||||
@ApiOperation("删除消息")
|
||||
@PreAuthorize("@ss.hasPermi('bgt:message:remove')")
|
||||
@Log(title = "消息" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iBgtMessageService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
|
||||
}
|
||||
}
|
@ -455,6 +455,18 @@ public class WgzAppController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【消息】获取消息列表-0全部 1报名 2工资 3其他 (打卡、系统)
|
||||
*/
|
||||
@ApiOperation("【消息】获取消息列表")
|
||||
@PreAuthorize("@ss.hasPermi('wgzApp:user:userGetMessageList')")
|
||||
@GetMapping("/WgzAppUserGetMessageList")
|
||||
public AjaxResult<WgzAppGetMessageListRes> userGetMessageList() {
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user