整理控制器类

pull/64/head
fengshuonan 2021-01-16 19:13:30 +08:00
parent 0a1e0025f6
commit cad52a9e88
6 changed files with 23 additions and 40 deletions

View File

@ -7,77 +7,74 @@ import cn.stylefeng.roses.kernel.dict.modular.service.DictTypeService;
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
/**
*
*
* @Author: huangyao
* @Date: 2021/1/6 20:52
**/
* @author huangyao
* @date 2021/1/16 19:07
*/
@Controller
@Slf4j
@ApiResource(name = "字典管理相关的界面渲染")
public class DictViewController {
private String PREFIX = "/modular/system/dict";
@Autowired
@Resource
private DictService dictService;
@Autowired
@Resource
private DictTypeService dictTypeService;
/**
* --
*
* @param
* @return
* @author huangyao
* @date 2021/1/9 22:37
*/
@GetResource(name = "字典管理-列表-视图", path = "/view/dict")
public ModelAndView indexView(ModelAndView view, @RequestParam Long dictTypeId) {
SysDictType dictType = dictTypeService.getById(dictTypeId);
view.addObject("dictTypeId", dictType.getDictTypeId());
view.addObject("dictTypeName", dictType.getDictTypeName());
view.addObject("dictTypeCode", dictType.getDictTypeCode());
view.setViewName(PREFIX + "/dict.html");
view.setViewName("/modular/system/dict/dict.html");
return view;
}
/**
* --
*
* @param
* @return
* @author huangyao
* @date 2021/1/9 22:37
*/
@GetResource(name = "字典管理-添加-视图", path = "/view/dict/addView")
public ModelAndView addView(ModelAndView view, @RequestParam Long dictTypeId) {
SysDictType dictType = dictTypeService.getById(dictTypeId);
view.addObject("dictTypeName", dictType.getDictTypeName());
view.addObject("dictTypeId", dictType.getDictTypeId());
view.addObject("dictTypeCode", dictType.getDictTypeCode());
view.setViewName(PREFIX + "/dict_add.html");
view.setViewName("/modular/system/dict/dict_add.html");
return view;
}
/**
* --
*
* @param
* @return
* @author huangyao
* @date 2021/1/9 22:38
*/
@GetResource(name = "字典管理-编辑-视图", path = "/view/dict/editView")
public ModelAndView editView(ModelAndView view, @RequestParam Long dictId) {
SysDict dict = dictService.getById(dictId);
// 根据字典获取字典类型
SysDictType dictType = dictTypeService.getOne(new QueryWrapper<SysDictType>().lambda().eq(SysDictType::getDelFlag, "N")
.eq(SysDictType::getDictTypeCode, dict.getDictTypeCode()));
@ -85,7 +82,8 @@ public class DictViewController {
view.addObject("dictTypeName", dictType.getDictTypeName());
view.addObject("dictId", dictId);
view.addObject("dictTypeCode", dictType.getDictTypeCode());
view.setViewName(PREFIX + "/dict_edit.html");
view.setViewName("/modular/system/dict/dict_edit.html");
return view;
}

View File

@ -4,7 +4,6 @@ import cn.stylefeng.guns.modular.index.service.IndexService;
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@ -17,7 +16,6 @@ import javax.annotation.Resource;
* @date 2020/12/27 16:23
*/
@Controller
@Slf4j
@ApiResource(name = "首页相关的界面渲染")
public class IndexViewController {

View File

@ -13,36 +13,29 @@ import org.springframework.stereotype.Controller;
*/
@Controller
@Slf4j
@ApiResource(name = "操作日志管理相关的界面渲染", path = "/view/log")
@ApiResource(name = "操作日志管理相关的界面渲染")
public class LogViewController {
private String PREFIX = "/modular/system/log";
/**
*
*
* @param
* @return
* @author TSQ
* @date 2021/1/5 15:18
*/
@GetResource(name = "操作日志管理列表", path = "")
@GetResource(name = "操作日志管理列表", path = "/view/log")
public String indexView() {
return PREFIX + "/log.html";
return "/modular/system/log/log.html";
}
/**
* -
*
* @param
* @return
* @author chenjinlong
* @date 2021/1/13 19:45
*/
@GetResource(name = "业务日志详情-视图", path = "detailView")
@GetResource(name = "业务日志详情-视图", path = "/view/log/detailView")
public String detailView() {
return PREFIX + "/log_detail.html";
return "/log_detail.html";
}
}

View File

@ -1,7 +1,5 @@
package cn.stylefeng.guns.modular.message.controller;
import cn.stylefeng.guns.modular.index.service.IndexService;
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
import cn.stylefeng.roses.kernel.message.api.MessageApi;
import cn.stylefeng.roses.kernel.message.api.enums.MessageReadFlagEnum;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageParam;
@ -11,7 +9,6 @@ import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
import java.util.List;
@ -30,8 +27,6 @@ public class MessageViewController {
@Resource
private MessageApi messageApi;
/**
*
*

View File

@ -2,7 +2,6 @@ package cn.stylefeng.guns.modular.organization;
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
/**
@ -12,7 +11,6 @@ import org.springframework.stereotype.Controller;
* @date 2020/12/28 9:28
*/
@Controller
@Slf4j
@ApiResource(name = "组织机构管理控制器界面")
public class OrganizationViewController {

View File

@ -48,4 +48,5 @@ public class TimersViewController {
public String editView() {
return "/modular/system/timers/timers_edit.html";
}
}