package com.yonge.cooleshow.api.feign;

import com.yonge.cooleshow.api.feign.fallback.AdminFeignServiceFallback;
import com.yonge.cooleshow.common.constant.AppConstant;
import com.yonge.cooleshow.common.entity.HttpResponseResult;
import com.yonge.cooleshow.common.entity.MallOrderItemDto;
import com.yonge.toolset.feign.config.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * Description
 *
 * @author liujunchi
 * @date 2022-05-06
 */
@FeignClient(name = AppConstant.APPLICATION_ADMIN + AppConstant.SERVER, configuration = FeignConfiguration.class,
        fallback = AdminFeignServiceFallback.class)
public interface AdminFeignService {
    /***
     * 轮询用户订单
     * @author liweifan
     * @updateTime 2022/3/28 15:34
     * @return: java.lang.Object
     */
    @GetMapping(value = "/task/pollingOrder")
    Object pollingOrder();

    /***
     * 一日一次，凌晨执行
     * @author liweifan
     * @updateTime 2022/3/28 15:34
     * @return: java.lang.Object
     */
    @GetMapping(value = "/task/daysTask")
    Object daysTask();

    /**
     * 老师作业布置通知
     */
    @PostMapping("/task/teacherSend")
    HttpResponseResult<Object> sendTodayNotRepliedAndNotDecorateHomework();

    //老师课酬
    @PostMapping(value = "/task/teacherEarning")
    HttpResponseResult<Object> sendTeacherEarning();


    /**
     * 设置商城收入分润
     */
    @PostMapping("/open/mallRecord")
    public HttpResponseResult<Boolean> mallRecord(@RequestBody List<MallOrderItemDto> shareDto ) ;

    /**
     * 设置商城收入状态
     */
    @PostMapping("/open/mallRecordState")
    public HttpResponseResult<Boolean> mallRecordState(@RequestBody  List<MallOrderItemDto> shareDto ) ;


    //老师课酬
    @PostMapping(value = "/task/refreshBlackList")
    HttpResponseResult refreshBlackList();

    @GetMapping(value = "/sysConfig/findConfigValue")
    HttpResponseResult<String> findConfigValue(String paramName);

}
