|
@@ -0,0 +1,47 @@
|
|
|
+package com.mooctest.crowd.site.service.impl;
|
|
|
+
|
|
|
+import com.mooctest.crowd.domain.dao.ApplicationTypeDao;
|
|
|
+import com.mooctest.crowd.domain.dao.FieldDao;
|
|
|
+import com.mooctest.crowd.domain.dao.TestTypeDao;
|
|
|
+import com.mooctest.crowd.domain.util.Converter;
|
|
|
+import com.mooctest.crowd.site.data.vo.ApplicationTypeVO;
|
|
|
+import com.mooctest.crowd.site.data.vo.FieldVO;
|
|
|
+import com.mooctest.crowd.site.data.vo.TestTypeVO;
|
|
|
+import com.mooctest.crowd.site.service.EnumsService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author guochao
|
|
|
+ * @date 2020-07-09 22:34
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class EnumsServiceImpl implements EnumsService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FieldDao fieldDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ApplicationTypeDao applicationTypeDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TestTypeDao testTypeDao;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<FieldVO> getAllField() {
|
|
|
+ return fieldDao.findAll().stream().map(fieldPO -> Converter.convert(FieldVO.class, fieldPO)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ApplicationTypeVO> getAllApplicationType() {
|
|
|
+ return applicationTypeDao.findAll().stream().map(applicationTypePO -> Converter.convert(ApplicationTypeVO.class, applicationTypePO)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<TestTypeVO> getAllType() {
|
|
|
+ return testTypeDao.findAll().stream().map(testTypePO -> Converter.convert(TestTypeVO.class, testTypePO)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+}
|