package me.zhengjie.modules.dmApp.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.AnonymousAccess;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.dm.daypc.service.DmDayPcService;
import me.zhengjie.modules.dm.daypc.service.dto.DmDayPcQueryCriteria;
import me.zhengjie.modules.dm.foodPj.domain.DmFoodPj;
import me.zhengjie.modules.dm.foodPj.service.DmFoodPjService;
import me.zhengjie.modules.dmApp.service.AppFoodPjService;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@Api(tags = "App 排菜接口")
@RequestMapping("/app/daypc")
public class AppFoodPjController {
    private final AppFoodPjService appFoodPjService;
    private final DmFoodPjService dmFoodPjService;

//    @GetMapping(value = "/appFoodPj")
//    @Log("App菜品评价")
//    @ApiOperation("App菜品评价")
//    public ResponseEntity<Object> appFoodPj(String userCode) {
//        return new ResponseEntity<>(appFoodPjService.selectAppFoodPj(userCode), HttpStatus.OK);
//    }

    @PostMapping(value = "/createApp")
    @Log("新增foodPj")
    @ApiOperation("新增foodPj")
    public ResponseEntity<Object> createApp(@Validated @RequestBody DmFoodPj resources){
        return new ResponseEntity<>(dmFoodPjService.createApp(resources),HttpStatus.CREATED);
    }

//    @AnonymousAccess
//    @GetMapping
//    @Log("查询daypc")
//    @ApiOperation("查询daypc")
//    public ResponseEntity<Object> query(DmDayPcQueryCriteria criteria, Pageable pageable) {
//        return new ResponseEntity<>(dmDayPcService.queryAll(criteria,pageable), HttpStatus.OK);
//    }

}
