package com.red.circle.other.app.inner.endpoint.pet;

import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.endpoint.pet.api.PetPoolClientApi;
import com.red.circle.other.app.inner.service.pet.PetPoolClientService;
import com.red.circle.other.inner.model.cmd.pet.PetAddCmd;
import com.red.circle.other.inner.model.cmd.pet.PetFeedingRecordCmd;
import com.red.circle.other.inner.model.dto.pet.PetFeedingRecordDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 宠物池管理.
 *
 * @author xiaofei on 2024/04/12
 */
@Validated
@RestController
@RequestMapping(value = PetPoolClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class PetPoolClientEndpoint implements PetPoolClientApi {

  private final PetPoolClientService petPoolClientService;

  @Override
  public ResultResponse<PageResult<PetFeedingRecordDTO>> feedingPage(PetFeedingRecordCmd query) {
    return ResultResponse.success(petPoolClientService.feedingPage(query));
  }

  @Override
  public ResultResponse<Void> addPet(PetAddCmd cmd) {
    return null;
  }

}
