/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the yifu4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.yifu.cloud.plus.v1.yifu.social.controller;

import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendPushService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialFriendService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 税友
 *
 * @author hgw
 * @date 2024-12-6 15:46:04
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/tsocialfriend")
@Tag(name = "税友")
public class TSocialFriendController {

	private final TSocialFriendService tSocialFriendService;
	private final TSocialFriendPushService tSocialFriendPushService;

	@Operation(description = "推送税友Test")
	@PostMapping("/pushFriendTest")
	public R<String> pushFriendTest(@RequestBody(required = false) List<String> dispatchIdList) {
		return tSocialFriendPushService.pushFriendTest(dispatchIdList);
	}

	/**
	 * @param addId 任务id，可为空
	 * @Description: 1获取税友状态
	 * @Author: hgw
	 * @Date: 2024/5/11 19:25
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	@Operation(description = "获取税友状态")
	@GetMapping("/getFiveJob")
	public R<String> getFiveJob(@RequestParam(required = false) String addId) {
		return tSocialFriendService.getFiveJob(addId);
	}

	/**
	 * @param dispatchIdList 派单id
	 * @Description: 推送税友
	 * @Author: hgw
	 * @Date: 2024/5/11 19:25
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	@Operation(description = "推送税友")
	@PostMapping("/pushSoldier")
	public R<String> pushSoldier(@RequestBody(required = false) List<String> dispatchIdList) {
		return tSocialFriendPushService.pushSoldier(dispatchIdList);
	}

	/**
	 * @Description: 1定时任务获取税友状态
	 * @Author: hgw
	 * @Date: 2024/5/11 19:26
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	@Operation(description = "1定时任务获取税友状态")
	@PostMapping("/inner/doInnerGetFiveJob")
	@SysLog("1每日定时任务获取税友状态")
	@Inner
	public R<String> doInnerGetFiveJob() {
		return tSocialFriendService.getFiveJob(null);
	}

	/**
	 * @Description: 2定时任务推送税友
	 * @Author: hgw
	 * @Date: 2024/5/11 19:26
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	@Operation(description = "2定时任务推送税友")
	@PostMapping("/inner/doInnerPushSoldier")
	@SysLog("2每日定时任务推送税友")
	@Inner
	public R<String> doInnerPushSoldier() {
		return tSocialFriendPushService.pushSoldier(null);
	}

	/**
	 * @Description: 3每日定时任务推送税友审核结果查询
	 * @Author: hgw
	 * @Date: 2024-5-24 17:01:56
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	@Operation(description = "3每日定时任务推送税友审核结果查询")
	@PostMapping("/inner/doInnerPushSoldierByAudit")
	@SysLog("4每日定时任务推送税友审核结果查询")
	@Inner
	public R<String> doInnerPushSoldierByAudit() {
		return tSocialFriendPushService.pushSoldierByAudit();
	}

	/**
	 * @Description: 4每日定时任务获取税友审核结果查询
	 * @Author: hgw
	 * @Date: 2024-5-24 17:02:00
	 * @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
	 **/
	@Operation(description = "4每日定时任务获取税友审核结果查询")
	@PostMapping("/inner/doInnerGetSixJobByAudit")
	@SysLog("4每日定时任务获取税友审核结果查询")
	@Inner
	public R<String> doInnerGetSixJobByAudit() {
		return tSocialFriendService.getSixJobByAudit();
	}

}
