init
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.xq.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.xq.domain.AreaCode;
|
||||
import com.ruoyi.xq.service.AreaCodeService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 行政区划
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-03-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xq/areaCode")
|
||||
public class AreaCodeController extends BaseController {
|
||||
|
||||
private final AreaCodeService areaCodeService;
|
||||
|
||||
/**
|
||||
* 查询行政区划列表
|
||||
*/
|
||||
@SaCheckPermission("xq:areaCode:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AreaCode> list(AreaCode bo, PageQuery pageQuery) {
|
||||
Page<AreaCode> page = areaCodeService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取行政区划详细信息
|
||||
*
|
||||
* @param code 主键
|
||||
*/
|
||||
@SaCheckPermission("xq:areaCode:query")
|
||||
@GetMapping("/{code}")
|
||||
public R<AreaCode> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Integer code) {
|
||||
return R.ok(areaCodeService.getById(code));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增行政区划
|
||||
*/
|
||||
@SaCheckPermission("xq:areaCode:add")
|
||||
@Log(title = "行政区划", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AreaCode bo) {
|
||||
return toAjax(areaCodeService.save(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改行政区划
|
||||
*/
|
||||
@SaCheckPermission("xq:areaCode:edit")
|
||||
@Log(title = "行政区划", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AreaCode bo) {
|
||||
return toAjax(areaCodeService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除行政区划
|
||||
*
|
||||
* @param codes 主键串
|
||||
*/
|
||||
@SaCheckPermission("xq:areaCode:remove")
|
||||
@Log(title = "行政区划", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{codes}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Integer[] codes) {
|
||||
return toAjax(areaCodeService.removeBatchByIds(Arrays.asList(codes)));
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,14 @@ public class HomeAppController {
|
||||
return R.ok(PageModel.build(vo));
|
||||
}
|
||||
|
||||
@GetMapping("/vip/page")
|
||||
@Operation(summary = "首页查询VIP推荐用户-分页")
|
||||
@Log(title = "首页查询VIP推荐用户-分页", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<List<HomeUserListVo>> vipPage(){
|
||||
List<HomeUserListVo> vo = userService.vipHomePage();
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/user/info")
|
||||
@Operation(summary = "查询用户主页信息")
|
||||
|
||||
@@ -4,8 +4,11 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.xq.domain.AreaCode;
|
||||
import com.ruoyi.xq.dto.app.areacode.AreaCodeQuery;
|
||||
import com.ruoyi.xq.dto.app.setting.AgreementDTO;
|
||||
import com.ruoyi.xq.service.AgreementSettingService;
|
||||
import com.ruoyi.xq.service.AreaCodeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -13,6 +16,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/setting")
|
||||
@Tag(name = "获取设置相关接口")
|
||||
@@ -21,6 +26,8 @@ public class SettingAppController {
|
||||
|
||||
@Autowired
|
||||
private AgreementSettingService agreementSettingService;
|
||||
@Autowired
|
||||
private AreaCodeService areaCodeService;
|
||||
|
||||
@GetMapping("/agreement/user")
|
||||
@Operation(summary = "获取用户协议")
|
||||
@@ -46,4 +53,12 @@ public class SettingAppController {
|
||||
return R.ok(new AgreementDTO(anchorJoinAgreement));
|
||||
}
|
||||
|
||||
@GetMapping("/areaCode/list")
|
||||
@Operation(summary = "获取省市区编码接口")
|
||||
@Log(title = "获取省市区编码接口", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<List<AreaCode>> listAreaCode(AreaCodeQuery query){
|
||||
List<AreaCode> list = areaCodeService.listAreaCode(query);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user