package cn.exploring.engine.server.wx.web;

import cn.exploring.engine.server.core.util.ResponseUtil;
import cn.exploring.engine.server.db.domain.ClassInfo;
import cn.exploring.engine.server.db.service.ClassService;
import cn.exploring.engine.server.db.service.StudentPointService;
import cn.exploring.engine.server.wx.annotation.LoginUser;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/wx/class")
@Validated
public class ClassController {

    @Resource
    ClassService classService;

    @GetMapping("addClass")
    public Object commitUserLessonRecord(@RequestParam String className) {
        String status = classService.addClassInfo(className);
        return status.contains("OK") ? ResponseUtil.ok(status) : ResponseUtil.fail(502, status);
    }

    

}
