package com.younike.server.controller;

import com.younike.common.annotation.Log;
import com.younike.common.core.controller.BaseController;
import com.younike.common.core.domain.AjaxResult;
import com.younike.common.enums.BusinessType;
import com.younike.framework.config.AnonymousAccess;
import com.younike.system.domain.ServerTime;
import com.younike.system.domain.ServerTimeSection;
import com.younike.system.domain.vo.ServerTimeSectionVo;
import com.younike.system.service.IServerTimeSectionService;
import com.younike.system.service.IServerTimeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 商品评价Controller
 *
 * @author elev
 * @date 2022-01-05
 */
@Api("时间子表")
@RestController
@RequestMapping("/server/time/section")
public class ServerServerTimeSectionController extends BaseController {
    @Autowired
    private IServerTimeSectionService serverTimeSectionService;

    /**
     * 修改时间子表
     */
    @ApiOperation("修改时间子表")
    @PostMapping("/updateServerTimeSection")
    @AnonymousAccess
    public AjaxResult updateServerTimeSection(@RequestBody ServerTimeSectionVo serverTimeSection) {
        return toAjax(serverTimeSectionService.updateServerTimeSectionVo(serverTimeSection));
    }
    /**
     * 新增时间子表
     */
    @ApiOperation("新增时间子表")
    @PostMapping("/addServerTimeSection")
    @AnonymousAccess
    public AjaxResult addServerTimeSection(@RequestBody ServerTimeSectionVo serverTimeSection) {
        return toAjax(serverTimeSectionService.insertServerTimeSectionVo(serverTimeSection));
    }
}
