| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.fasterxml.jackson.databind.DeserializationFeature; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.highdatas.mdm.entity.MenuMapping; |
| | | import com.highdatas.mdm.entity.SysField; |
| | | import com.highdatas.mdm.entity.SysMenu; |
| | | import com.highdatas.mdm.pojo.CodeMsg; |
| | | import com.highdatas.mdm.pojo.Result; |
| | | import com.highdatas.mdm.service.IMenuMappingService; |
| | | import com.highdatas.mdm.service.ISysFieldService; |
| | | import com.highdatas.mdm.service.ISysMenuService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.awt.*; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | public class SysFieldController { |
| | | @Autowired |
| | | ISysFieldService fieldService; |
| | | @Autowired |
| | | ISysMenuService menuService; |
| | | @Autowired |
| | | IMenuMappingService menuMappingService; |
| | | |
| | | |
| | | @RequestMapping(value = "/{tableName}", method = RequestMethod.GET) |
| | | public Result todoTask(@PathVariable String tableName){ |
| | |
| | | |
| | | return Result.success(fieldList); |
| | | } |
| | | @RequestMapping(value = "/menu/{id}", method = RequestMethod.GET) |
| | | public Result getFieldByMenu(@PathVariable String id){ |
| | | MenuMapping menuMapping = menuMappingService.selectOne(new EntityWrapper<MenuMapping>().eq("menu_id", id)); |
| | | if (menuMapping == null) { |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | String tableName = menuMapping.getTableName(); |
| | | if (StringUtils.isEmpty(tableName)) { |
| | | return Result.error(CodeMsg.ERROR_PARAMS_NOT_MATHED); |
| | | } |
| | | List<SysField> fieldList = fieldService.selectList(new EntityWrapper<SysField>().eq("table_name", tableName).orderBy("order_no")); |
| | | |
| | | return Result.success(fieldList); |
| | | } |
| | | |
| | | @RequestMapping(value = "/update", method = RequestMethod.GET) |
| | | public Result update(@RequestParam String json) { |