fix: 添加@Slf4j注解修复编译错误

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
2026-01-07 11:05:49 +08:00
parent eefe7167ee
commit e3f158985a

View File

@@ -5,6 +5,7 @@ import com.qiniu.util.Auth;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
@@ -22,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
* @author BladeX * @author BladeX
*/ */
@RestController @RestController
@Slf4j
@AllArgsConstructor @AllArgsConstructor
@RequestMapping("/martial/athlete") @RequestMapping("/martial/athlete")
@Tag(name = "参赛选手管理", description = "参赛选手接口") @Tag(name = "参赛选手管理", description = "参赛选手接口")
@@ -55,8 +57,13 @@ public class MartialAthleteController extends BladeController {
@PostMapping("/submit") @PostMapping("/submit")
@Operation(summary = "新增或修改", description = "传入实体") @Operation(summary = "新增或修改", description = "传入实体")
public R submit(@RequestBody MartialAthlete athlete) { public R submit(@RequestBody MartialAthlete athlete) {
athlete.setCreateUser(AuthUtil.getUserId()); Long userId = AuthUtil.getUserId();
athlete.setUpdateUser(AuthUtil.getUserId()); log.info("=== 提交选手 === userId: {}, playerName: {}", userId, athlete.getPlayerName());
// Only set createUser for new records (when id is null)
if (athlete.getId() == null) {
athlete.setCreateUser(userId);
}
athlete.setUpdateUser(userId);
return R.status(athleteService.saveOrUpdate(athlete)); return R.status(athleteService.saveOrUpdate(athlete));
} }