commit
This commit is contained in:
+67
@@ -0,0 +1,67 @@
|
||||
package com.budwk.app.zhgh.staffbenefit.psychology.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.staffbenefit.psychology.model.PsychologyDoctor;
|
||||
import com.budwk.app.zhgh.staffbenefit.psychology.service.PsychologyDoctorService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author zzr
|
||||
* @name:PsychologyIndexController
|
||||
* @Date 2025/9/12 10:54
|
||||
* @version 1.0
|
||||
* @注释
|
||||
*/
|
||||
@Slf4j
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@Api(tags = "心理咨询")
|
||||
@At("/platform/psychology/index")
|
||||
public class PsychologyIndexController {
|
||||
|
||||
@Inject
|
||||
private PsychologyDoctorService psychologyDoctorService;
|
||||
|
||||
@At("")
|
||||
// @SaCheckPermission("psychology.index")
|
||||
@Ok("beetl:/platform/zhgh/staffbenefit/psychology/index/index.html")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
// @SaCheckPermission("psychology.index")
|
||||
@Ok("beetl:/platform/zhghh5/staffbenefit/psychology/index/index.html")
|
||||
public void h5() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ApiOperation("手机端咨询师列表展示")
|
||||
// @SaCheckPermission("psychology.index")
|
||||
public Result listConsultantByH5(){
|
||||
Pagination<PsychologyDoctor> pagination = psychologyDoctorService.listPage(1, 4, Cnd.NEW());
|
||||
List<PsychologyDoctor> list = pagination.getList();
|
||||
// 判断有没有咨询师,并且咨询师数量小于4的话,要顺序填充到4个,便于前端展示
|
||||
if (Lang.isNotEmpty(list) && list.size() < 4) {
|
||||
List<PsychologyDoctor> filledList = new ArrayList<>(4);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
filledList.add(list.get(i % list.size()));
|
||||
}
|
||||
pagination.setList(filledList);
|
||||
}
|
||||
return Result.success(pagination.getList());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user