| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package com.tld.controller;
- import com.tld.model.Dictionary;
- import com.tld.service.DictionaryService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import javax.servlet.http.HttpServletRequest;
- import java.util.Map;
- /**
- * 字典管理
- */
- @RestController
- @RequestMapping("dictionary")
- public class DictionaryController {
- @Autowired
- private DictionaryService dictionaryService;
- /**
- * 查询字典内容
- * @param dictionary 参数
- * @return 返回结果
- */
- @GetMapping("getDictionary")
- public Map<String, Object> getDictionary(Dictionary dictionary){
- return dictionaryService.getDictionary(dictionary);
- }
- /**
- * 查询字典分页内容
- * @param dictionary 参数
- * @return 返回结果
- */
- @GetMapping("getDictionaryPage")
- public Map<String, Object> getDictionaryPage(Dictionary dictionary){
- return dictionaryService.getDictionaryPage(dictionary);
- }
- /**
- * 新增字典内容
- * @param dictionary 参数
- * @param request 参数
- * @return 返回结果
- */
- @PostMapping("addDictionary")
- public Map<String, Object> addDictionary(@RequestBody Dictionary dictionary, HttpServletRequest request){
- return dictionaryService.addDiction(dictionary, request);
- }
- /**
- * 修改字典内容
- * @param dictionary 参数
- * @return 返回结果
- */
- @PostMapping("updateDictionary")
- public Map<String, Object> updateDictionary(@RequestBody Dictionary dictionary, HttpServletRequest request){
- return dictionaryService.updateDictionary(dictionary, request);
- }
- /**
- * 删除字典内容
- * @param dictionary 参数
- * @return 返回结果
- */
- @DeleteMapping("deleteDictionary")
- public Map<String, Object> deleteDictionary(Dictionary dictionary){
- return dictionaryService.deleteDictionary(dictionary);
- }
- }
|