Browse Source

新增可用区域列表

tags/v2.4.1
xiaoying 1 year ago
parent
commit
3a673d836e
1 changed files with 24 additions and 6 deletions
  1. +24
    -6
      tuoheng_oidc_admin/src/main/java/com/tuoheng/controller/AreaController.java

+ 24
- 6
tuoheng_oidc_admin/src/main/java/com/tuoheng/controller/AreaController.java View File

package com.tuoheng.controller; package com.tuoheng.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.enums.MarkTypeEnum;
import com.tuoheng.model.dto.LoginUser; import com.tuoheng.model.dto.LoginUser;
import com.tuoheng.model.entity.Area; import com.tuoheng.model.entity.Area;
import com.tuoheng.model.query.AreaQuery; import com.tuoheng.model.query.AreaQuery;


/** /**
* 查询区域信息 * 查询区域信息
*
* @param query * @param query
* @return * @return
*/ */
@GetMapping("/index") @GetMapping("/index")
public JsonResult index(AreaQuery query){
return areaService.index(query);
public JsonResult index(AreaQuery query) {
return areaService.index(query);
}

/**
* 查询存在的区域信息
*
* @return
*/
@GetMapping("/list")
public JsonResult list() {
return JsonResult.success(areaService.list(Wrappers.<Area>lambdaQuery().eq(Area::getMark, MarkTypeEnum.VALID.getCode())));
} }


/** /**
* 新增区域信息 * 新增区域信息
*
* @param entity * @param entity
* @return * @return
*/ */
@PostMapping("/add") @PostMapping("/add")
public JsonResult add(@RequestBody @Validated Area entity,@CurrentUser LoginUser loginUser){
return areaService.edit(entity,loginUser);
public JsonResult add(@RequestBody @Validated Area entity, @CurrentUser LoginUser loginUser) {
return areaService.edit(entity, loginUser);
} }

/** /**
* 新增区域信息 * 新增区域信息
*
* @param entity * @param entity
* @return * @return
*/ */
@PutMapping("/edit") @PutMapping("/edit")
public JsonResult edit(@RequestBody @Validated Area entity, @CurrentUser LoginUser loginUser){
return areaService.edit(entity,loginUser);
public JsonResult edit(@RequestBody @Validated Area entity, @CurrentUser LoginUser loginUser) {
return areaService.edit(entity, loginUser);
} }


/** /**
* 逻辑删除/批量 * 逻辑删除/批量
*
* @param ids * @param ids
* @return * @return
*/ */

Loading…
Cancel
Save