修改价格;证书返回图片url
This commit is contained in:
parent
77e48de989
commit
171937b29d
|
@ -3,11 +3,13 @@ package org.dromara.scale.controller.wx;
|
|||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.scale.domain.bo.CounselorBo;
|
||||
import org.dromara.scale.domain.bo.CounselorExperienceBo;
|
||||
import org.dromara.scale.domain.bo.CounselorQualificationBo;
|
||||
import org.dromara.scale.domain.bo.ReservationDayBo;
|
||||
|
@ -22,6 +24,7 @@ import org.dromara.scale.service.IReservationService;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -102,4 +105,47 @@ public class WxCounselorController extends BaseController {
|
|||
return R.ok(experienceService.queryList(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增培训经历
|
||||
*/
|
||||
@Log(title = "新增培训经历", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/experience")
|
||||
public R<Void> addExperience(@Validated(AddGroup.class) @RequestBody CounselorExperienceBo bo) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
bo.setCounselorId(userId);
|
||||
return toAjax(experienceService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改培训经历
|
||||
*/
|
||||
@Log(title = "修改培训经历", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/experience")
|
||||
public R<Void> editExperience(@Validated(EditGroup.class) @RequestBody CounselorExperienceBo bo) {
|
||||
CounselorExperienceVo old = experienceService.queryById(bo.getId());
|
||||
Long userId = LoginHelper.getUserId();
|
||||
Long counselorId = old.getCounselorId();
|
||||
if (!userId.equals(counselorId)) {
|
||||
R.fail("无法修改他人信息");
|
||||
}
|
||||
bo.setCounselorId(userId);
|
||||
return toAjax(experienceService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改预约价格
|
||||
*/
|
||||
@Log(title = "修改预约价格", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping("/price")
|
||||
public R<Void> editPrice(String price) {
|
||||
Long userId = LoginHelper.getUserId();
|
||||
CounselorBo bo = new CounselorBo();
|
||||
bo.setId(userId);
|
||||
bo.setPrice(new BigDecimal(price));
|
||||
return toAjax(counselorService.updateByBo(bo));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package org.dromara.scale.domain.vo;
|
||||
|
||||
import org.dromara.scale.domain.CounselorQualification;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import io.github.linpeilie.annotations.AutoMapping;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.translation.annotation.Translation;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.scale.domain.CounselorQualification;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
|
@ -52,5 +52,9 @@ public class CounselorQualificationVo implements Serializable {
|
|||
@ExcelProperty(value = "证书图片")
|
||||
private Long certificateImage;
|
||||
|
||||
@Translation(type = TransConstant.OSS_ID_TO_URL)
|
||||
@AutoMapping(target = "certificateImage")
|
||||
private Long certificateImageUrl;
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue