init web
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
package com.sunyard.chsm.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sunyard.chsm.dto.KeyTemplateDTO;
|
||||
import com.sunyard.chsm.model.R;
|
||||
import com.sunyard.chsm.service.KeyTemplateService;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 密钥模版管理接口
|
||||
* @author liulu
|
||||
* @since 2024/10/22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/key/template")
|
||||
public class KeyTemplateController {
|
||||
|
||||
@Resource
|
||||
private KeyTemplateService keyTemplateService;
|
||||
|
||||
/**
|
||||
* 分页查询密钥模版
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @return 分页列表
|
||||
*/
|
||||
@GetMapping("/pageList")
|
||||
public R<Page<KeyTemplateDTO.View>> servicePageList(KeyTemplateDTO.Query query) {
|
||||
|
||||
Page<KeyTemplateDTO.View> page = keyTemplateService.selectPageList(query);
|
||||
|
||||
return R.data(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加密钥模版
|
||||
*
|
||||
* @param save 参数
|
||||
* @return id
|
||||
*/
|
||||
@PostMapping
|
||||
public R<String> save(@Valid @RequestBody KeyTemplateDTO.Save save) {
|
||||
Long id = keyTemplateService.save(save);
|
||||
return R.data(String.valueOf(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改密钥模版
|
||||
*
|
||||
* @param update 参数
|
||||
* @return void
|
||||
*/
|
||||
@PutMapping
|
||||
public R<Void> update(@Valid @RequestBody KeyTemplateDTO.Save update) {
|
||||
keyTemplateService.update(update);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除密钥模版
|
||||
*
|
||||
* @param id id
|
||||
* @return void
|
||||
*/
|
||||
@DeleteMapping
|
||||
public R<Void> delete(Long id) {
|
||||
keyTemplateService.delete(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user