diff --git a/.gitignore b/.gitignore index f09b618..22feb07 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ replay_pid* /target/ /AGENTS.md /.xcodemap/ +/src/test/ diff --git a/.idea/.cache/.Apifox_Helper/.toolWindow.db b/.idea/.cache/.Apifox_Helper/.toolWindow.db index 97c283a..9d18612 100644 Binary files a/.idea/.cache/.Apifox_Helper/.toolWindow.db and b/.idea/.cache/.Apifox_Helper/.toolWindow.db differ diff --git a/.idea/MyBatisCodeHelperDatasource.xml b/.idea/MyBatisCodeHelperDatasource.xml index 5318661..a8314bc 100644 --- a/.idea/MyBatisCodeHelperDatasource.xml +++ b/.idea/MyBatisCodeHelperDatasource.xml @@ -4,8 +4,44 @@ diff --git a/src/main/java/vvpkassistant/controller/PkItemController.java b/src/main/java/vvpkassistant/controller/PkItemController.java new file mode 100644 index 0000000..2dc25c8 --- /dev/null +++ b/src/main/java/vvpkassistant/controller/PkItemController.java @@ -0,0 +1,24 @@ +package vvpkassistant.controller; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import vvpkassistant.Data.ResponseData; +import vvpkassistant.item.model.PkItem; +import vvpkassistant.item.service.PkItemService; + +import javax.annotation.Resource; +import java.util.List; + +@RestController +@RequestMapping("pkItem") +public class PkItemController { + + @Resource + private PkItemService pkItemService; + + @GetMapping("list") + public ResponseData> list() { + return ResponseData.success(pkItemService.selectItemList()); + } +} diff --git a/src/main/java/vvpkassistant/item/PkItemMapper.java b/src/main/java/vvpkassistant/item/PkItemMapper.java new file mode 100644 index 0000000..68e9dfe --- /dev/null +++ b/src/main/java/vvpkassistant/item/PkItemMapper.java @@ -0,0 +1,27 @@ +package vvpkassistant.item; + +import org.apache.ibatis.annotations.Mapper; +import vvpkassistant.item.model.PkItem; + +import java.util.List; + +/* +* @author: ziin +* @date: 2026/3/27 10:13 +*/ +@Mapper +public interface PkItemMapper { + int deleteByPrimaryKey(Long id); + + int insert(PkItem record); + + int insertSelective(PkItem record); + + PkItem selectByPrimaryKey(Long id); + + List selectItemList(); + + int updateByPrimaryKeySelective(PkItem record); + + int updateByPrimaryKey(PkItem record); +} diff --git a/src/main/java/vvpkassistant/item/model/PkItem.java b/src/main/java/vvpkassistant/item/model/PkItem.java new file mode 100644 index 0000000..8eb8a83 --- /dev/null +++ b/src/main/java/vvpkassistant/item/model/PkItem.java @@ -0,0 +1,78 @@ +package vvpkassistant.item.model; + +import lombok.Data; + +import java.util.Date; + +/* +* @author: ziin +* @date: 2026/3/27 10:13 +*/ +@Data +public class PkItem { + /** + * 主键Id + */ + private Long id; + + /** + * 套餐名称 + */ + private String itemName; + + /** + * 套餐价格 + */ + private Integer itemPrice; + + /** + * 套餐描述 + */ + private String itemDesc; + + /** + * 功能 + */ + private String itemFunction; + + /** + * 时长 + */ + private Integer itemDuration; + + /** + * 是否上架 + */ + private Integer itemStatus; + + /** + * 备注 + */ + private String remark; + + /** + * 创建者 + */ + private String creator; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新者 + */ + private String updater; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 是否删除 + */ + private Boolean deleted; + +} \ No newline at end of file diff --git a/src/main/java/vvpkassistant/item/service/PkItemService.java b/src/main/java/vvpkassistant/item/service/PkItemService.java new file mode 100644 index 0000000..2aed87b --- /dev/null +++ b/src/main/java/vvpkassistant/item/service/PkItemService.java @@ -0,0 +1,13 @@ +package vvpkassistant.item.service; + +import vvpkassistant.item.model.PkItem; + +import java.util.List; + +/* + * @author: ziin + * @date: 2026/3/27 10:13 + */ +public interface PkItemService { + List selectItemList(); +} diff --git a/src/main/java/vvpkassistant/item/service/PkItemServiceImpl.java b/src/main/java/vvpkassistant/item/service/PkItemServiceImpl.java new file mode 100644 index 0000000..b935ab8 --- /dev/null +++ b/src/main/java/vvpkassistant/item/service/PkItemServiceImpl.java @@ -0,0 +1,24 @@ +package vvpkassistant.item.service; + +import org.springframework.stereotype.Service; +import vvpkassistant.item.PkItemMapper; +import vvpkassistant.item.model.PkItem; + +import javax.annotation.Resource; +import java.util.List; + +/* + * @author: ziin + * @date: 2026/3/27 10:13 + */ +@Service +public class PkItemServiceImpl implements PkItemService { + + @Resource + private PkItemMapper pkItemMapper; + + @Override + public List selectItemList() { + return pkItemMapper.selectItemList(); + } +} diff --git a/src/main/resources/mapper/PkItemMapper.xml b/src/main/resources/mapper/PkItemMapper.xml new file mode 100644 index 0000000..878786d --- /dev/null +++ b/src/main/resources/mapper/PkItemMapper.xml @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + id, item_name, item_price, item_desc, item_function, item_duration, item_status, + remark, creator, create_time, updater, update_time, deleted + + + + + + delete from pk_item + where id = #{id,jdbcType=BIGINT} + + + + insert into pk_item (id, item_name, item_price, + item_desc, item_function, item_duration, + item_status, remark, creator, + create_time, updater, update_time, + deleted) + values (#{id,jdbcType=BIGINT}, #{itemName,jdbcType=VARCHAR}, #{itemPrice,jdbcType=INTEGER}, + #{itemDesc,jdbcType=VARCHAR}, #{itemFunction,jdbcType=VARCHAR}, #{itemDuration,jdbcType=INTEGER}, + #{itemStatus,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updater,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, + #{deleted,jdbcType=BIT}) + + + + insert into pk_item + + + id, + + + item_name, + + + item_price, + + + item_desc, + + + item_function, + + + item_duration, + + + item_status, + + + remark, + + + creator, + + + create_time, + + + updater, + + + update_time, + + + deleted, + + + + + #{id,jdbcType=BIGINT}, + + + #{itemName,jdbcType=VARCHAR}, + + + #{itemPrice,jdbcType=INTEGER}, + + + #{itemDesc,jdbcType=VARCHAR}, + + + #{itemFunction,jdbcType=VARCHAR}, + + + #{itemDuration,jdbcType=INTEGER}, + + + #{itemStatus,jdbcType=INTEGER}, + + + #{remark,jdbcType=VARCHAR}, + + + #{creator,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updater,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{deleted,jdbcType=BIT}, + + + + + + update pk_item + + + item_name = #{itemName,jdbcType=VARCHAR}, + + + item_price = #{itemPrice,jdbcType=INTEGER}, + + + item_desc = #{itemDesc,jdbcType=VARCHAR}, + + + item_function = #{itemFunction,jdbcType=VARCHAR}, + + + item_duration = #{itemDuration,jdbcType=INTEGER}, + + + item_status = #{itemStatus,jdbcType=INTEGER}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + updater = #{updater,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + deleted = #{deleted,jdbcType=BIT}, + + + where id = #{id,jdbcType=BIGINT} + + + + update pk_item + set item_name = #{itemName,jdbcType=VARCHAR}, + item_price = #{itemPrice,jdbcType=INTEGER}, + item_desc = #{itemDesc,jdbcType=VARCHAR}, + item_function = #{itemFunction,jdbcType=VARCHAR}, + item_duration = #{itemDuration,jdbcType=INTEGER}, + item_status = #{itemStatus,jdbcType=INTEGER}, + remark = #{remark,jdbcType=VARCHAR}, + creator = #{creator,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + updater = #{updater,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + deleted = #{deleted,jdbcType=BIT} + where id = #{id,jdbcType=BIGINT} + +