|  | @@ -0,0 +1,44 @@
 | 
	
		
			
				|  |  | +package com.mooctest.crowd.site.controller;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import com.mooctest.crowd.domain.domainobject.CrowdTestProject;
 | 
	
		
			
				|  |  | +import com.mooctest.crowd.domain.model.CrowdTestProjectPO;
 | 
	
		
			
				|  |  | +import com.mooctest.crowd.site.data.dto.CrowdTestSquareIndexDTO;
 | 
	
		
			
				|  |  | +import com.mooctest.crowd.site.service.CrowdProjectService;
 | 
	
		
			
				|  |  | +import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.GetMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RequestMapping;
 | 
	
		
			
				|  |  | +import org.springframework.web.bind.annotation.RestController;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +import java.util.List;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +/**
 | 
	
		
			
				|  |  | + * @author:xx
 | 
	
		
			
				|  |  | + * @date:2020/6/20
 | 
	
		
			
				|  |  | + * @description:
 | 
	
		
			
				|  |  | + */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +@RestController
 | 
	
		
			
				|  |  | +@RequestMapping("/api/square")
 | 
	
		
			
				|  |  | +public class CrowTestSquareController {
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private CrowdProjectService crowdProjectService;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    /**
 | 
	
		
			
				|  |  | +     * 获取众测广场首页所有的数据 包装到CrowdTestSquareIndexDTO里面
 | 
	
		
			
				|  |  | +     *
 | 
	
		
			
				|  |  | +     * @return
 | 
	
		
			
				|  |  | +     */
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    @GetMapping("/list")
 | 
	
		
			
				|  |  | +    public CrowdTestSquareIndexDTO getAll() {
 | 
	
		
			
				|  |  | +        CrowdTestSquareIndexDTO crowdTestSquareIndexDTO = new CrowdTestSquareIndexDTO();
 | 
	
		
			
				|  |  | +        List<CrowdTestProject> list = crowdProjectService.getAll();
 | 
	
		
			
				|  |  | +        crowdTestSquareIndexDTO.setCrowdTestProjectPOS(list);
 | 
	
		
			
				|  |  | +        return crowdTestSquareIndexDTO;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +}
 |