perf:场馆和用户接口
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
package com.xiang.app.module.jntyzx.pojo.req;
|
||||||
|
|
||||||
|
import com.xiang.xservice.basic.common.req.BaseRequest;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-04-09 09:39
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class VenueInfoQueryRequest extends BaseRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期
|
||||||
|
*/
|
||||||
|
@NotNull(message = "日期不能为空")
|
||||||
|
private LocalDate date;
|
||||||
|
/**
|
||||||
|
* 时间段 例如 20:00-21:00
|
||||||
|
*/
|
||||||
|
private String sj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场地名称
|
||||||
|
*/
|
||||||
|
private String placeName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.xiang.app.module.jntyzx.pojo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-04-09 10:00
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class VenueInfoSubscribeRequest {
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.xiang.app.module.jntyzx.pojo.resp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-04-09 09:42
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class VenueInfoQueryResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场地名称
|
||||||
|
*/
|
||||||
|
private String placeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期
|
||||||
|
*/
|
||||||
|
private LocalDate date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间范围
|
||||||
|
*/
|
||||||
|
private String sjName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 价格
|
||||||
|
*/
|
||||||
|
private BigDecimal money;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系人
|
||||||
|
*/
|
||||||
|
private String contacts;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0:可订购 2:zlb 4:已订购
|
||||||
|
*/
|
||||||
|
private Integer type;
|
||||||
|
private Long placeMainId;
|
||||||
|
private Integer placeId;
|
||||||
|
private Integer scheduleId;
|
||||||
|
private String className;
|
||||||
|
private String classCode;
|
||||||
|
private String appointments;
|
||||||
|
private String cTypeCode;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.xiang.app.modules.jntyzx.converts;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.resp.VenueInfoQueryResp;
|
||||||
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-04-09 09:54
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface VenueInfoConverter {
|
||||||
|
|
||||||
|
Page<VenueInfoQueryResp> toPage(Page<VenueInfoDO> page);
|
||||||
|
}
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.xiang.app.modules.jntyzx.manage;
|
package com.xiang.app.modules.jntyzx.manage;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -15,4 +17,6 @@ public interface IVenueInfoManage extends IService<VenueInfoDO> {
|
|||||||
List<VenueInfoDO> queryByDate(LocalDate date);
|
List<VenueInfoDO> queryByDate(LocalDate date);
|
||||||
|
|
||||||
List<VenueInfoDO> queryByType(LocalDate date, Integer type);
|
List<VenueInfoDO> queryByType(LocalDate date, Integer type);
|
||||||
|
|
||||||
|
Page<VenueInfoDO> page(VenueInfoQueryRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,12 @@ package com.xiang.app.modules.jntyzx.manage;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
import com.xiang.app.modules.jntyzx.mapper.JntyzxVenueInfoMapper;
|
import com.xiang.app.modules.jntyzx.mapper.JntyzxVenueInfoMapper;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -30,4 +33,18 @@ public class VenueInfoManageImpl extends ServiceImpl<JntyzxVenueInfoMapper, Venu
|
|||||||
lqw.eq(VenueInfoDO::getType, type);
|
lqw.eq(VenueInfoDO::getType, type);
|
||||||
return baseMapper.selectList(lqw);
|
return baseMapper.selectList(lqw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<VenueInfoDO> page(VenueInfoQueryRequest request) {
|
||||||
|
Page<VenueInfoDO> page = new Page<>(request.getCurrent(), request.getPageSize());
|
||||||
|
LambdaQueryWrapper<VenueInfoDO> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(VenueInfoDO::getDate, request.getDate());
|
||||||
|
if (StringUtils.isNotBlank(request.getSj())) {
|
||||||
|
lqw.eq(VenueInfoDO::getSjName, request.getSj());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(request.getPlaceName())) {
|
||||||
|
lqw.like(VenueInfoDO::getPlaceName, request.getPlaceName());
|
||||||
|
}
|
||||||
|
return baseMapper.selectPage(page, lqw);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
package com.xiang.app.modules.jntyzx.service;
|
package com.xiang.app.modules.jntyzx.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.resp.VenueInfoQueryResp;
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,4 +36,11 @@ public interface IVenueService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean saveTomorrowVenueInfo(List<SitePositionList> sitePositionLists);
|
boolean saveTomorrowVenueInfo(List<SitePositionList> sitePositionLists);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询场地列表信息
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Page<VenueInfoQueryResp> list(@NotNull(message = "请求参数不能为空") @Valid VenueInfoQueryRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class UserTokenInfoServiceImpl implements IUserTokenInfoService {
|
|||||||
public boolean updateTokenByName(String name, String token) {
|
public boolean updateTokenByName(String name, String token) {
|
||||||
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(name);
|
UserTokenInfoDO userTokenInfoDO = userTokenInfoManage.getByName(name);
|
||||||
if (Objects.isNull(userTokenInfoDO)) {
|
if (Objects.isNull(userTokenInfoDO)) {
|
||||||
return false;
|
throw new BusinessException("用户信息不存在!");
|
||||||
}
|
}
|
||||||
userTokenInfoDO.setToken(token);
|
userTokenInfoDO.setToken(token);
|
||||||
boolean flag = userTokenInfoManage.updateById(userTokenInfoDO);
|
boolean flag = userTokenInfoManage.updateById(userTokenInfoDO);
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.xiang.app.modules.jntyzx.service.impl;
|
package com.xiang.app.modules.jntyzx.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.resp.VenueInfoQueryResp;
|
||||||
|
import com.xiang.app.modules.jntyzx.converts.VenueInfoConverter;
|
||||||
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
import com.xiang.app.modules.jntyzx.entity.pojo.VenueInfoDO;
|
||||||
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
import com.xiang.app.modules.jntyzx.entity.resp.query.SitePositionList;
|
||||||
import com.xiang.app.modules.jntyzx.manage.IVenueInfoManage;
|
import com.xiang.app.modules.jntyzx.manage.IVenueInfoManage;
|
||||||
@@ -34,6 +38,7 @@ public class VenueServiceImpl implements IVenueService {
|
|||||||
private final IJntyzxHttpService jntyzxHttpService;
|
private final IJntyzxHttpService jntyzxHttpService;
|
||||||
private final IVenueInfoManage venueInfoManage;
|
private final IVenueInfoManage venueInfoManage;
|
||||||
private final IUserTokenInfoService userTokenInfoService;
|
private final IUserTokenInfoService userTokenInfoService;
|
||||||
|
private final VenueInfoConverter venueInfoConverter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SitePositionList> queryVenueService() {
|
public List<SitePositionList> queryVenueService() {
|
||||||
@@ -155,6 +160,12 @@ public class VenueServiceImpl implements IVenueService {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<VenueInfoQueryResp> list(VenueInfoQueryRequest request) {
|
||||||
|
Page<VenueInfoDO> page = venueInfoManage.page(request);
|
||||||
|
return venueInfoConverter.toPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateDatabase(List<SitePositionList> list, boolean isToday) {
|
private void updateDatabase(List<SitePositionList> list, boolean isToday) {
|
||||||
List<VenueInfoDO> venueInfoDOS = Lists.newArrayList();
|
List<VenueInfoDO> venueInfoDOS = Lists.newArrayList();
|
||||||
if (isToday) {
|
if (isToday) {
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.xiang.app.server.jntyzx;
|
||||||
|
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IJtOrderService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-04-09 10:01
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/private/apps/jntyzx/order")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class OrderServer {
|
||||||
|
private final IJtOrderService orderService;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.xiang.app.server.jntyzx;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoQueryRequest;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.req.VenueInfoSubscribeRequest;
|
||||||
|
import com.xiang.app.module.jntyzx.pojo.resp.VenueInfoQueryResp;
|
||||||
|
import com.xiang.app.modules.jntyzx.service.IVenueService;
|
||||||
|
import com.xiang.xservice.basic.common.resp.Result;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: xiang
|
||||||
|
* @Date: 2026-04-09 09:36
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/private/apps/jntyzx/venue")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class VenueInfoServer {
|
||||||
|
|
||||||
|
private final IVenueService venueService;
|
||||||
|
|
||||||
|
@PostMapping("/page")
|
||||||
|
public Result<Page<VenueInfoQueryResp>> list(@RequestBody @NotNull(message = "请求参数不能为空") @Valid VenueInfoQueryRequest request) {
|
||||||
|
return Result.data(venueService.list(request));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/subscribe")
|
||||||
|
public Result<Boolean> subscribe(@RequestBody @NotNull(message = "请求参数不能为空") @Valid VenueInfoSubscribeRequest request) {
|
||||||
|
return Result.data(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@ spring:
|
|||||||
namespace: 00131110-3ecb-4a35-8bbb-624edde1d937
|
namespace: 00131110-3ecb-4a35-8bbb-624edde1d937
|
||||||
server-addr: http://general.xiangtech.xyz:8848
|
server-addr: http://general.xiangtech.xyz:8848
|
||||||
# 是否启用健康检查
|
# 是否启用健康检查
|
||||||
register-enabled: false
|
# register-enabled: false
|
||||||
username: nacos
|
username: nacos
|
||||||
password: nacos
|
password: nacos
|
||||||
datasource:
|
datasource:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: local
|
active: outside
|
||||||
application:
|
application:
|
||||||
name: xservice-cornucopia
|
name: xservice-cornucopia
|
||||||
main:
|
main:
|
||||||
|
|||||||
Reference in New Issue
Block a user