This commit is contained in:
cjw 2024-08-19 17:07:36 +08:00
parent 0cb015dfb3
commit 1bb3237515
7 changed files with 46 additions and 6 deletions

View File

@ -10,11 +10,14 @@ import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.web.core.BaseController; import org.dromara.common.web.core.BaseController;
import org.dromara.scale.domain.bo.ReservationDayBo; import org.dromara.scale.domain.bo.ReservationDayBo;
import org.dromara.scale.domain.vo.CounselorVo; import org.dromara.scale.domain.vo.CounselorVo;
import org.dromara.scale.domain.vo.ReservationDayVo;
import org.dromara.scale.service.ICounselorService; import org.dromara.scale.service.ICounselorService;
import org.dromara.scale.service.IReservationService; import org.dromara.scale.service.IReservationService;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* <p>TODO<p> * <p>TODO<p>
* *
@ -38,7 +41,7 @@ public class WxCounselorController extends BaseController {
@GetMapping() @GetMapping()
public R<CounselorVo> getInfo() { public R<CounselorVo> getInfo() {
Long userId = LoginHelper.getUserId(); Long userId = LoginHelper.getUserId();
return R.ok(counselorService.queryById(userId)); return R.ok(counselorService.queryByUserId(userId));
} }
/** /**
@ -51,5 +54,9 @@ public class WxCounselorController extends BaseController {
return toAjax(reservationService.insertByBo(bo)); return toAjax(reservationService.insertByBo(bo));
} }
@GetMapping("/date")
public R<List<ReservationDayVo>> getReservationList(String time, Long userId) {
return null;
}
} }

View File

@ -1,13 +1,13 @@
package org.dromara.scale.domain; package org.dromara.scale.domain;
import org.dromara.common.mybatis.core.domain.BaseEntity; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import org.dromara.common.mybatis.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serial; import java.io.Serial;
import java.util.Date;
/** /**
* 预约-时间对象 m_reservation_time * 预约-时间对象 m_reservation_time
@ -24,7 +24,7 @@ public class ReservationTime extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* *
*/ */
@TableId(value = "id") @TableId(value = "id")
private Long id; private Long id;
@ -49,5 +49,10 @@ public class ReservationTime extends BaseEntity {
*/ */
private Date endTime; private Date endTime;
/**
* 状态0未预约1已预约
*/
private Integer status;
} }

View File

@ -55,5 +55,10 @@ public class ReservationTimeBo extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime; private Date endTime;
/**
* 状态0未预约1已预约
*/
private Integer status;
} }

View File

@ -15,6 +15,14 @@ import java.util.List;
*/ */
public interface ICounselorService { public interface ICounselorService {
/**
* 查询心理咨询师
*
* @param id 用户id
* @return 心理咨询师
*/
CounselorVo queryByUserId(Long id);
/** /**
* 查询心理咨询师 * 查询心理咨询师
* *

View File

@ -1,7 +1,10 @@
package org.dromara.scale.service; package org.dromara.scale.service;
import org.dromara.scale.domain.ReservationDay;
import org.dromara.scale.domain.bo.ReservationDayBo; import org.dromara.scale.domain.bo.ReservationDayBo;
import java.util.List;
public interface IReservationService { public interface IReservationService {
/** /**
@ -11,4 +14,6 @@ public interface IReservationService {
* @return 是否新增成功 * @return 是否新增成功
*/ */
Boolean insertByBo(ReservationDayBo bo); Boolean insertByBo(ReservationDayBo bo);
List<ReservationDay> selectList();
} }

View File

@ -42,6 +42,11 @@ public class CounselorServiceImpl implements ICounselorService {
* @param id 主键 * @param id 主键
* @return 心理咨询师 * @return 心理咨询师
*/ */
@Override
public CounselorVo queryByUserId(Long id) {
return baseMapper.selectVoOne(new LambdaQueryWrapper<Counselor>().eq(Counselor::getUserId, id));
}
@Override @Override
public CounselorVo queryById(Long id) { public CounselorVo queryById(Long id) {
return baseMapper.selectVoById(id); return baseMapper.selectVoById(id);

View File

@ -68,4 +68,9 @@ public class ReservationServiceImpl implements IReservationService {
} }
return flag; return flag;
} }
@Override
public List<ReservationDay> selectList() {
return List.of();
}
} }