feat(shop): 添加优惠券管理和用户优惠券管理功能
- 新增 ShopCoupon 和 ShopUserCoupon 实体类 - 实现优惠券和用户优惠券的 CRUD 操作 - 添加分页查询、批量操作等接口 - 集成权限控制和操作日志记录refactor(shop): 重构Shop模块的实体类和映射文件 - 更新了多个实体类的创建时间和修改时间字段类型,从Date改为LocalDateTime - 优化了部分实体类的属性结构,移除了不必要的字段 - 更新了多个Mapper接口的作者信息 - 为ShopUserRefereeController添加了权限控制注解
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -153,7 +153,7 @@
|
||||
<dependency>
|
||||
<groupId>com.ibeetl</groupId>
|
||||
<artifactId>beetl</artifactId>
|
||||
<version>3.15.10.RELEASE</version>
|
||||
<version>3.6.1.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringDoc OpenAPI 3 -->
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 优惠券控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:24
|
||||
*/
|
||||
@Tag(name = "优惠券管理")
|
||||
@RestController
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 分销商申请记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:50:19
|
||||
*/
|
||||
@Tag(name = "分销商申请记录表管理")
|
||||
@RestController
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 分销商资金明细表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "分销商资金明细表管理")
|
||||
@RestController
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 分销商订单记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "分销商订单记录表管理")
|
||||
@RestController
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 分销商推荐关系表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "分销商推荐关系表管理")
|
||||
@RestController
|
||||
|
||||
@@ -6,8 +6,10 @@ import com.gxwebsoft.shop.entity.ShopDealerSetting;
|
||||
import com.gxwebsoft.shop.param.ShopDealerSettingParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -20,7 +22,7 @@ import java.util.List;
|
||||
* 分销商设置表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "分销商设置表管理")
|
||||
@RestController
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 分销商用户记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "分销商用户记录表管理")
|
||||
@RestController
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 分销商提现明细表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "分销商提现明细表管理")
|
||||
@RestController
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 用户优惠券控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "用户优惠券管理")
|
||||
@RestController
|
||||
|
||||
@@ -10,8 +10,8 @@ import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 用户推荐关系表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-05 17:05:28
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Tag(name = "用户推荐关系表管理")
|
||||
@RestController
|
||||
@@ -31,6 +31,7 @@ public class ShopUserRefereeController extends BaseController {
|
||||
@Resource
|
||||
private ShopUserRefereeService shopUserRefereeService;
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUserReferee:list')")
|
||||
@Operation(summary = "分页查询用户推荐关系表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<ShopUserReferee>> page(ShopUserRefereeParam param) {
|
||||
@@ -38,6 +39,7 @@ public class ShopUserRefereeController extends BaseController {
|
||||
return success(shopUserRefereeService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUserReferee:list')")
|
||||
@Operation(summary = "查询全部用户推荐关系表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<ShopUserReferee>> list(ShopUserRefereeParam param) {
|
||||
@@ -53,6 +55,8 @@ public class ShopUserRefereeController extends BaseController {
|
||||
return success(shopUserRefereeService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUserReferee:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加用户推荐关系表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody ShopUserReferee shopUserReferee) {
|
||||
@@ -67,6 +71,8 @@ public class ShopUserRefereeController extends BaseController {
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUserReferee:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改用户推荐关系表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody ShopUserReferee shopUserReferee) {
|
||||
@@ -76,6 +82,8 @@ public class ShopUserRefereeController extends BaseController {
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUserReferee:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除用户推荐关系表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
@@ -85,6 +93,8 @@ public class ShopUserRefereeController extends BaseController {
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUserReferee:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加用户推荐关系表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<ShopUserReferee> list) {
|
||||
@@ -94,6 +104,8 @@ public class ShopUserRefereeController extends BaseController {
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUserReferee:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改用户推荐关系表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopUserReferee> batchParam) {
|
||||
@@ -103,6 +115,8 @@ public class ShopUserRefereeController extends BaseController {
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:shopUserReferee:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除用户推荐关系表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
|
||||
@@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -17,7 +15,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 优惠券
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -85,10 +83,10 @@ public class ShopCoupon implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Data createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "发放总数量(-1表示无限制)")
|
||||
private Integer totalCount;
|
||||
|
||||
@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -14,7 +12,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商申请记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:50:18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -57,9 +55,9 @@ public class ShopDealerApply implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -15,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商资金明细表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -49,9 +47,9 @@ public class ShopDealerCapital implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -15,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商订单记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -67,9 +65,9 @@ public class ShopDealerOrder implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,8 +4,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -14,7 +12,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商推荐关系表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -39,9 +37,9 @@ public class ShopDealerReferee implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商设置表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -15,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商用户记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -70,9 +68,9 @@ public class ShopDealerUser implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -15,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商提现明细表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -67,9 +65,9 @@ public class ShopDealerWithdraw implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 用户优惠券
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -24,7 +24,7 @@ public class ShopUserCoupon implements Serializable {
|
||||
|
||||
@Schema(description = "id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "优惠券模板ID")
|
||||
private Integer couponId;
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.kuaidi100.sdk.request.samecity.OrderGoods;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -19,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 用户推荐关系表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-05 17:05:28
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -51,53 +45,9 @@ public class ShopUserReferee implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
@Schema(description = "被推荐人的报餐信息")
|
||||
@TableField(exist = false)
|
||||
private List<ShopOrder> order;
|
||||
|
||||
@Schema(description = "被推荐人的报餐菜品")
|
||||
@TableField(exist = false)
|
||||
private List<OrderGoods> orderGoods;
|
||||
|
||||
@Schema(description = "被推荐人昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "被推荐人头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "被推荐人等级ID")
|
||||
@TableField(exist = false)
|
||||
private Integer gradeId;
|
||||
|
||||
@Schema(description = "被推荐人等级")
|
||||
@TableField(exist = false)
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "推荐人昵称")
|
||||
@TableField(exist = false)
|
||||
private String dealerName;
|
||||
|
||||
@Schema(description = "推荐人头像")
|
||||
@TableField(exist = false)
|
||||
private String dealerAvatar;
|
||||
|
||||
@Schema(description = "推荐人电话")
|
||||
@TableField(exist = false)
|
||||
private String dealerPhone;
|
||||
|
||||
@Schema(description = "用户所属门店")
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "所属门店")
|
||||
@TableField(exist = false)
|
||||
private ShopMerchant merchant;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 优惠券Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:23
|
||||
*/
|
||||
public interface ShopCouponMapper extends BaseMapper<ShopCoupon> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 分销商申请记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:50:18
|
||||
*/
|
||||
public interface ShopDealerApplyMapper extends BaseMapper<ShopDealerApply> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 分销商资金明细表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerCapitalMapper extends BaseMapper<ShopDealerCapital> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 分销商订单记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerOrderMapper extends BaseMapper<ShopDealerOrder> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 分销商推荐关系表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerRefereeMapper extends BaseMapper<ShopDealerReferee> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 分销商设置表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerSettingMapper extends BaseMapper<ShopDealerSetting> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 分销商用户记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerUserMapper extends BaseMapper<ShopDealerUser> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 分销商提现明细表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerWithdrawMapper extends BaseMapper<ShopDealerWithdraw> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 用户优惠券Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopUserCouponMapper extends BaseMapper<ShopUserCoupon> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 用户推荐关系表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-05 17:05:28
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopUserRefereeMapper extends BaseMapper<ShopUserReferee> {
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 优惠券查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:37
|
||||
* @since 2025-08-11 23:51:23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商申请记录表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:38
|
||||
* @since 2025-08-11 23:50:17
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商资金明细表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:40
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商订单记录表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商推荐关系表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商设置表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商用户记录表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 分销商提现明细表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 用户优惠券查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -14,7 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 用户推荐关系表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-05 17:05:28
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 优惠券Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:23
|
||||
*/
|
||||
public interface ShopCouponService extends IService<ShopCoupon> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 分销商申请记录表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:50:18
|
||||
*/
|
||||
public interface ShopDealerApplyService extends IService<ShopDealerApply> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 分销商资金明细表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerCapitalService extends IService<ShopDealerCapital> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 分销商订单记录表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerOrderService extends IService<ShopDealerOrder> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 分销商推荐关系表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerRefereeService extends IService<ShopDealerReferee> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 分销商设置表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerSettingService extends IService<ShopDealerSetting> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 分销商用户记录表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerUserService extends IService<ShopDealerUser> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 分销商提现明细表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopDealerWithdrawService extends IService<ShopDealerWithdraw> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 用户优惠券Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopUserCouponService extends IService<ShopUserCoupon> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 用户推荐关系表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-05 17:05:28
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
public interface ShopUserRefereeService extends IService<ShopUserReferee> {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 优惠券Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:23
|
||||
*/
|
||||
@Service
|
||||
public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCoupon> implements ShopCouponService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 分销商申请记录表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:50:18
|
||||
*/
|
||||
@Service
|
||||
public class ShopDealerApplyServiceImpl extends ServiceImpl<ShopDealerApplyMapper, ShopDealerApply> implements ShopDealerApplyService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 分销商资金明细表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Service
|
||||
public class ShopDealerCapitalServiceImpl extends ServiceImpl<ShopDealerCapitalMapper, ShopDealerCapital> implements ShopDealerCapitalService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 分销商订单记录表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Service
|
||||
public class ShopDealerOrderServiceImpl extends ServiceImpl<ShopDealerOrderMapper, ShopDealerOrder> implements ShopDealerOrderService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 分销商推荐关系表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Service
|
||||
public class ShopDealerRefereeServiceImpl extends ServiceImpl<ShopDealerRefereeMapper, ShopDealerReferee> implements ShopDealerRefereeService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 分销商设置表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Service
|
||||
public class ShopDealerSettingServiceImpl extends ServiceImpl<ShopDealerSettingMapper, ShopDealerSetting> implements ShopDealerSettingService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 分销商用户记录表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Service
|
||||
public class ShopDealerUserServiceImpl extends ServiceImpl<ShopDealerUserMapper, ShopDealerUser> implements ShopDealerUserService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 分销商提现明细表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:44:39
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Service
|
||||
public class ShopDealerWithdrawServiceImpl extends ServiceImpl<ShopDealerWithdrawMapper, ShopDealerWithdraw> implements ShopDealerWithdrawService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 用户优惠券Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-11 09:41:38
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Service
|
||||
public class ShopUserCouponServiceImpl extends ServiceImpl<ShopUserCouponMapper, ShopUserCoupon> implements ShopUserCouponService {
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 用户推荐关系表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-05 17:05:28
|
||||
* @since 2025-08-11 23:51:41
|
||||
*/
|
||||
@Service
|
||||
public class ShopUserRefereeServiceImpl extends ServiceImpl<ShopUserRefereeMapper, ShopUserReferee> implements ShopUserRefereeService {
|
||||
|
||||
@@ -200,6 +200,9 @@ public class ShopGenerator {
|
||||
map.put("authAnnotation", AUTH_ANNOTATION);
|
||||
map.put("logAnnotation", LOG_ANNOTATION);
|
||||
map.put("controllerMappingPrefix", CONTROLLER_MAPPING_PREFIX);
|
||||
// 添加项目类型标识,用于模板中的条件判断
|
||||
map.put("isUniApp", false); // Vue 项目
|
||||
map.put("isVueAdmin", true); // 后台管理项目
|
||||
this.setMap(map);
|
||||
}
|
||||
};
|
||||
@@ -228,7 +231,9 @@ public class ShopGenerator {
|
||||
+ tableInfo.getEntityPath() + "/" + "index.ts";
|
||||
}
|
||||
});
|
||||
focList.add(new FileOutConfig() {
|
||||
// UniApp 使用专门的模板
|
||||
String uniappTemplatePath = TEMPLATES_DIR + "/index.ts.uniapp.btl";
|
||||
focList.add(new FileOutConfig(uniappTemplatePath) {
|
||||
@Override
|
||||
public String outputFile(TableInfo tableInfo) {
|
||||
return OUTPUT_LOCATION_UNIAPP + OUTPUT_DIR_VUE
|
||||
@@ -246,7 +251,9 @@ public class ShopGenerator {
|
||||
+ tableInfo.getEntityPath() + "/model/" + "index.ts";
|
||||
}
|
||||
});
|
||||
focList.add(new FileOutConfig(templatePath) {
|
||||
// UniApp 使用专门的 model 模板
|
||||
String uniappModelTemplatePath = TEMPLATES_DIR + "/model.ts.uniapp.btl";
|
||||
focList.add(new FileOutConfig(uniappModelTemplatePath) {
|
||||
@Override
|
||||
public String outputFile(TableInfo tableInfo) {
|
||||
return OUTPUT_LOCATION_UNIAPP + OUTPUT_DIR_VUE
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { ${entity}, ${entity}Param } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询${table.comment!}
|
||||
*/
|
||||
export async function page${entity}(params: ${entity}Param) {
|
||||
const res = await request.get<ApiResult<PageResult<${entity}>>>(
|
||||
MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}/page',
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -24,7 +23,7 @@ export async function page${entity}(params: ${entity}Param) {
|
||||
*/
|
||||
export async function list${entity}(params?: ${entity}Param) {
|
||||
const res = await request.get<ApiResult<${entity}[]>>(
|
||||
MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -40,7 +39,7 @@ export async function list${entity}(params?: ${entity}Param) {
|
||||
*/
|
||||
export async function add${entity}(data: ${entity}) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -54,7 +53,7 @@ export async function add${entity}(data: ${entity}) {
|
||||
*/
|
||||
export async function update${entity}(data: ${entity}) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
@@ -68,7 +67,7 @@ export async function update${entity}(data: ${entity}) {
|
||||
*/
|
||||
export async function remove${entity}(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}/' + id
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
@@ -81,7 +80,7 @@ export async function remove${entity}(id?: number) {
|
||||
*/
|
||||
export async function removeBatch${entity}(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}/batch',
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
@@ -97,7 +96,7 @@ export async function removeBatch${entity}(data: (number | undefined)[]) {
|
||||
*/
|
||||
export async function get${entity}(id: number) {
|
||||
const res = await request.get<ApiResult<${entity}>>(
|
||||
MODULES_API_URL + '/${package.ModuleName}/${controllerMappingHyphen}/' + id
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api/index';
|
||||
import type { ${entity}, ${entity}Param } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询${table.comment!}
|
||||
*/
|
||||
export async function page${entity}(params: ${entity}Param) {
|
||||
const res = await request.get<ApiResult<PageResult<${entity}>>>(
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询${table.comment!}列表
|
||||
*/
|
||||
export async function list${entity}(params?: ${entity}Param) {
|
||||
const res = await request.get<ApiResult<${entity}[]>>(
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
params
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加${table.comment!}
|
||||
*/
|
||||
export async function add${entity}(data: ${entity}) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改${table.comment!}
|
||||
*/
|
||||
export async function update${entity}(data: ${entity}) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除${table.comment!}
|
||||
*/
|
||||
export async function remove${entity}(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除${table.comment!}
|
||||
*/
|
||||
export async function removeBatch${entity}(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询${table.comment!}
|
||||
*/
|
||||
export async function get${entity}(id: number) {
|
||||
const res = await request.get<ApiResult<${entity}>>(
|
||||
'/${package.ModuleName}/${controllerMappingHyphen}/' + id
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* ${table.comment!}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import type { PageParam } from '@/api/index';
|
||||
|
||||
/**
|
||||
* ${table.comment!}
|
||||
*/
|
||||
export interface ${entity} {
|
||||
<% /** -----------BEGIN 字段循环遍历----------- **/ %>
|
||||
<% for(field in table.fields) { %>
|
||||
<%
|
||||
var keyPropertyName;
|
||||
if(field.keyFlag) {
|
||||
keyPropertyName = field.propertyName;
|
||||
}
|
||||
%>
|
||||
<% /* 主键 */ %>
|
||||
<% if(field.keyFlag) { %>
|
||||
<% /* 普通字段 */ %>
|
||||
<% } else if(isNotEmpty(field.fill)) { %>
|
||||
<% if(field.convert){ %>
|
||||
@TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill})
|
||||
<% }else{ %>
|
||||
@TableField(fill = FieldFill.${field.fill})
|
||||
<% } %>
|
||||
<% } else if(field.convert) { %>
|
||||
@TableField("${field.annotationColumnName}")
|
||||
<% } %>
|
||||
// ${field.comment}
|
||||
${field.propertyName}?: <% if(field.propertyType == 'Integer') { %>number<% }else{ %>string<% } %>;
|
||||
<% } %>
|
||||
<% /** -----------END 字段循环遍历----------- **/ %>
|
||||
}
|
||||
|
||||
/**
|
||||
* ${table.comment!}搜索条件
|
||||
*/
|
||||
export interface ${entity}Param extends PageParam {
|
||||
<% for(field in table.fields) { %>
|
||||
<% if(field.keyFlag) { %>
|
||||
${field.propertyName}?: number;
|
||||
<% } %>
|
||||
<% } %>
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user