entityClass,QueryFilter filter){
+ String tableName = BeanUtil.getTableName(entityClass).toUpperCase();
+ StringBuilder sql = new StringBuilder("DELETE FROM " + tableName);
+ if(filter != null){
+ if(!StringUtils.isEmpty(filter.getWhere())){
+ sql.append(" WHERE " + filter.getWhere());
+ }
+ }
+ return sql.toString();
+ }
+
+
+
+
+
+ private static String join(Object[] arr) {
+ StringBuilder sb = new StringBuilder();
+ for (Object s : arr) {
+ sb.append(s + ",");
+ }
+ String str = sb.toString();
+ return str.substring(0, str.length() - 1);
+ }
+
+ public static String join2(Object[] arr) {
+ StringBuilder sb = new StringBuilder();
+ for (Object s : arr) {
+ sb.append("#{param2." + s + "},");
+ }
+ String str = sb.toString();
+ return str.substring(0, str.length() - 1);
+ }
+ public static String join3(Object[] arr) {
+ StringBuilder sb = new StringBuilder();
+ for (Object s : arr) {
+ sb.append("#{item." + s + "},");
+ }
+ String str = sb.toString();
+ return str.substring(0, str.length() - 1);
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/common/orm/QueryFilter.java b/src/main/java/com/krt/dairy/common/orm/QueryFilter.java
new file mode 100644
index 0000000..14e5fc9
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/orm/QueryFilter.java
@@ -0,0 +1,24 @@
+package com.krt.dairy.common.orm;
+
+
+/**
+ * 简单查询,目前只支持简单的 = 和 <> 查询
+ * 只支持3个简单查询
+ * @author bc_qi
+ */
+public class QueryFilter {
+
+ Integer timeCount = 0;//计数器
+ private StringBuilder where = new StringBuilder("");//最多3个条件
+ private StringBuilder sort = new StringBuilder("");
+
+ public String getWhere() {
+ return where.toString();
+ }
+
+ public String getSort(){
+ return sort.toString();
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/common/web/error/ErrorController.java b/src/main/java/com/krt/dairy/common/web/error/ErrorController.java
new file mode 100644
index 0000000..d3ea19c
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/error/ErrorController.java
@@ -0,0 +1,36 @@
+package com.krt.dairy.common.web.error;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+@Controller
+@RequestMapping("/error")
+public class ErrorController {
+
+ @RequestMapping("/101")
+ public ModelAndView error101(){
+ return new ModelAndView("error/101");
+ }
+
+ @RequestMapping("/403")
+ public ModelAndView error403(){
+ return new ModelAndView("error/403");
+ }
+
+ @RequestMapping("/404")
+ public ModelAndView error404(){
+ return new ModelAndView("error/404");
+ }
+
+ @RequestMapping("/500")
+ public ModelAndView error500(){
+ return new ModelAndView("error/500");
+ }
+
+ @RequestMapping("/405")
+ public ModelAndView error405(){
+ return new ModelAndView("error/405");
+ }
+
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/ShiroFreeMarkerConfigurer.java b/src/main/java/com/krt/dairy/common/web/shiro/ShiroFreeMarkerConfigurer.java
new file mode 100644
index 0000000..67d2b9c
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/ShiroFreeMarkerConfigurer.java
@@ -0,0 +1,18 @@
+package com.krt.dairy.common.web.shiro;
+
+import com.krt.dairy.common.web.shiro.freemarker.ShiroTags;
+import freemarker.template.TemplateException;
+import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
+
+import java.io.IOException;
+
+/**
+ * shiro freemarker 整合
+ */
+public class ShiroFreeMarkerConfigurer extends FreeMarkerConfigurer {
+ @Override
+ public void afterPropertiesSet() throws IOException, TemplateException {
+ super.afterPropertiesSet();
+ this.getConfiguration().setSharedVariable("shiro", new ShiroTags());
+ }
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/AuthenticatedTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/AuthenticatedTag.java
new file mode 100644
index 0000000..3fb7015
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/AuthenticatedTag.java
@@ -0,0 +1,44 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.core.Environment;
+import freemarker.log.Logger;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateException;
+
+import java.io.IOException;
+import java.util.Map;
+
+
+/**
+ * JSP tag that renders the tag body only if the current user has executed a successful authentication attempt
+ * during their current session.
+ *
+ * This is more restrictive than the {@link UserTag}, which only
+ * ensures the current user is known to the system, either via a current login or from Remember Me services,
+ * which only makes the assumption that the current user is who they say they are, and does not guarantee it like
+ * this tag does.
+ *
+ *
The logically opposite tag of this one is the {@link NotAuthenticatedTag}
+ *
+ *
Equivalent to {@link org.apache.shiro.web.tags.AuthenticatedTag}
+ *
+ * @since 0.2
+ */
+public class AuthenticatedTag extends SecureTag {
+ private static final Logger log = Logger.getLogger("AuthenticatedTag");
+
+ @Override
+ public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException {
+ if (getSubject() != null && getSubject().isAuthenticated()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Subject exists and is authenticated. Tag body will be evaluated.");
+ }
+
+ renderBody(env, body);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Subject does not exist or is not authenticated. Tag body will not be evaluated.");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/GuestTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/GuestTag.java
new file mode 100644
index 0000000..c48a6f4
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/GuestTag.java
@@ -0,0 +1,42 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.core.Environment;
+import freemarker.log.Logger;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateException;
+
+import java.io.IOException;
+import java.util.Map;
+
+
+/**
+ * JSP tag that renders the tag body if the current user is not known to the system, either because they
+ * haven't logged in yet, or because they have no 'RememberMe' identity.
+ *
+ * The logically opposite tag of this one is the {@link UserTag}. Please read that class's JavaDoc as it explains
+ * more about the differences between Authenticated/Unauthenticated and User/Guest semantic differences.
+ *
+ *
Equivalent to {@link org.apache.shiro.web.tags.GuestTag}
+ *
+ * @since 0.9
+ */
+public class GuestTag extends SecureTag {
+ private static final Logger log = Logger.getLogger("AuthenticatedTag");
+
+ @Override
+ public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException {
+ if (getSubject() == null || getSubject().getPrincipal() == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Subject does not exist or does not have a known identity (aka 'principal'). " +
+ "Tag body will be evaluated.");
+ }
+
+ renderBody(env, body);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Subject exists or has a known identity (aka 'principal'). " +
+ "Tag body will not be evaluated.");
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasAnyRolesTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasAnyRolesTag.java
new file mode 100644
index 0000000..0001d59
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasAnyRolesTag.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import org.apache.shiro.subject.Subject;
+
+
+/**
+ * Displays body content if the current user has any of the roles specified.
+ *
+ * Equivalent to {@link org.apache.shiro.web.tags.HasAnyRolesTag}
+ *
+ * @since 0.2
+ */
+public class HasAnyRolesTag extends RoleTag {
+ // Delimeter that separates role names in tag attribute
+ private static final String ROLE_NAMES_DELIMETER = ",";
+
+ protected boolean showTagBody(String roleNames) {
+ boolean hasAnyRole = false;
+ Subject subject = getSubject();
+
+ if (subject != null) {
+ // Iterate through roles and check to see if the user has one of the roles
+ for (String role : roleNames.split(ROLE_NAMES_DELIMETER)) {
+ if (subject.hasRole(role.trim())) {
+ hasAnyRole = true;
+ break;
+ }
+ }
+ }
+
+ return hasAnyRole;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasPermissionTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasPermissionTag.java
new file mode 100644
index 0000000..cc15a86
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasPermissionTag.java
@@ -0,0 +1,12 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+/**
+ * Equivalent to {@link org.apache.shiro.web.tags.HasPermissionTag}
+ *
+ * @since 0.1
+ */
+public class HasPermissionTag extends PermissionTag {
+ protected boolean showTagBody(String p) {
+ return isPermitted(p);
+ }
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasRoleTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasRoleTag.java
new file mode 100644
index 0000000..908300e
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/HasRoleTag.java
@@ -0,0 +1,10 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+/**
+ * Equivalent to {@link org.apache.shiro.web.tags.HasRoleTag}
+ */
+public class HasRoleTag extends RoleTag {
+ protected boolean showTagBody(String roleName) {
+ return getSubject() != null && getSubject().hasRole(roleName);
+ }
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/LacksPermissionTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/LacksPermissionTag.java
new file mode 100644
index 0000000..99786a7
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/LacksPermissionTag.java
@@ -0,0 +1,10 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+/**
+ * Equivalent to {@link org.apache.shiro.web.tags.LacksPermissionTag}
+ */
+public class LacksPermissionTag extends PermissionTag {
+ protected boolean showTagBody(String p) {
+ return !isPermitted(p);
+ }
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/LacksRoleTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/LacksRoleTag.java
new file mode 100644
index 0000000..23e6802
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/LacksRoleTag.java
@@ -0,0 +1,11 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+/**
+ * Equivalent to {@link org.apache.shiro.web.tags.LacksRoleTag}
+ */
+public class LacksRoleTag extends RoleTag {
+ protected boolean showTagBody(String roleName) {
+ boolean hasRole = getSubject() != null && getSubject().hasRole(roleName);
+ return !hasRole;
+ }
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/NotAuthenticatedTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/NotAuthenticatedTag.java
new file mode 100644
index 0000000..2874e0c
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/NotAuthenticatedTag.java
@@ -0,0 +1,32 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.core.Environment;
+import freemarker.log.Logger;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateException;
+
+import java.io.IOException;
+import java.util.Map;
+
+
+/**
+ * Freemarker tag that renders the tag body only if the current user has not executed a successful authentication
+ * attempt during their current session.
+ *
+ * The logically opposite tag of this one is the {@link org.apache.shiro.web.tags.AuthenticatedTag}.
+ *
+ *
Equivalent to {@link org.apache.shiro.web.tags.NotAuthenticatedTag}
+ */
+public class NotAuthenticatedTag extends SecureTag {
+ static final Logger log = Logger.getLogger("NotAuthenticatedTag");
+
+ @Override
+ public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException {
+ if (getSubject() == null || !getSubject().isAuthenticated()) {
+ log.debug("Subject does not exist or is not authenticated. Tag body will be evaluated.");
+ renderBody(env, body);
+ } else {
+ log.debug("Subject exists and is authenticated. Tag body will not be evaluated.");
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/PermissionTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/PermissionTag.java
new file mode 100644
index 0000000..7d0cf06
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/PermissionTag.java
@@ -0,0 +1,43 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.core.Environment;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateModelException;
+
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Equivalent to {@link org.apache.shiro.web.tags.PermissionTag}
+ */
+public abstract class PermissionTag extends SecureTag {
+ String getName(Map params) {
+ return getParam(params, "name");
+ }
+
+ @Override
+ protected void verifyParameters(Map params) throws TemplateModelException {
+ String permission = getName(params);
+
+ if (permission == null || permission.length() == 0) {
+ throw new TemplateModelException("The 'name' tag attribute must be set.");
+ }
+ }
+
+ @Override
+ public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException {
+ String p = getName(params);
+
+ boolean show = showTagBody(p);
+ if (show) {
+ renderBody(env, body);
+ }
+ }
+
+ protected boolean isPermitted(String p) {
+ return getSubject() != null && getSubject().isPermitted(p);
+ }
+
+ protected abstract boolean showTagBody(String p);
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/PrincipalTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/PrincipalTag.java
new file mode 100644
index 0000000..43fcbce
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/PrincipalTag.java
@@ -0,0 +1,119 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.core.Environment;
+import freemarker.log.Logger;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateException;
+import freemarker.template.TemplateModelException;
+
+import java.beans.BeanInfo;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Tag used to print out the String value of a user's default principal,
+ * or a specific principal as specified by the tag's attributes.
+ *
+ * If no attributes are specified, the tag prints out the toString()
+ * value of the user's default principal. If the type attribute
+ * is specified, the tag looks for a principal with the given type. If the
+ * property attribute is specified, the tag prints the string value of
+ * the specified property of the principal. If no principal is found or the user
+ * is not authenticated, the tag displays nothing unless a defaultValue
+ * is specified.
+ *
+ * Equivalent to {@link org.apache.shiro.web.tags.PrincipalTag}
+ *
+ * @since 0.2
+ */
+public class PrincipalTag extends SecureTag {
+ static final Logger log = Logger.getLogger("PrincipalTag");
+
+ /**
+ * The type of principal to be retrieved, or null if the default principal should be used.
+ */
+ String getType(Map params) {
+ return getParam(params, "type");
+ }
+
+ /**
+ * The property name to retrieve of the principal, or null if the toString() value should be used.
+ */
+ String getProperty(Map params) {
+ return getParam(params, "property");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException {
+ String result = null;
+
+ if (getSubject() != null) {
+ // Get the principal to print out
+ Object principal;
+
+ if (getType(params) == null) {
+ principal = getSubject().getPrincipal();
+ } else {
+ principal = getPrincipalFromClassName(params);
+ }
+
+ // Get the string value of the principal
+ if (principal != null) {
+ String property = getProperty(params);
+
+ if (property == null) {
+ result = principal.toString();
+ } else {
+ result = getPrincipalProperty(principal, property);
+ }
+ }
+ }
+
+ // Print out the principal value if not null
+ if (result != null) {
+ try {
+ env.getOut().write(result);
+ } catch (IOException ex) {
+ throw new TemplateException("Error writing ["+result+"] to Freemarker.", ex, env);
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ Object getPrincipalFromClassName(Map params) {
+ String type = getType(params);
+
+ try {
+ Class cls = Class.forName(type);
+
+ return getSubject().getPrincipals().oneByType(cls);
+ } catch (ClassNotFoundException ex) {
+ log.error("Unable to find class for name ["+type+"]", ex);
+ }
+
+ return null;
+ }
+
+ String getPrincipalProperty(Object principal, String property) throws TemplateModelException {
+ try {
+ BeanInfo beanInfo = Introspector.getBeanInfo(principal.getClass());
+
+ // Loop through the properties to get the string value of the specified property
+ for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) {
+ if (propertyDescriptor.getName().equals(property)) {
+ Object value = propertyDescriptor.getReadMethod().invoke(principal, (Object[]) null);
+
+ return String.valueOf(value);
+ }
+ }
+
+ // property not found, throw
+ throw new TemplateModelException("Property ["+property+"] not found in principal of type ["+principal.getClass().getName()+"]");
+ } catch (Exception ex) {
+ throw new TemplateModelException("Error reading property ["+property+"] from principal of type ["+principal.getClass().getName()+"]", ex);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/RoleTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/RoleTag.java
new file mode 100644
index 0000000..8194144
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/RoleTag.java
@@ -0,0 +1,27 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.core.Environment;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateException;
+
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Equivalent to {@link org.apache.shiro.web.tags.RoleTag}
+ */
+public abstract class RoleTag extends SecureTag {
+ String getName(Map params) {
+ return getParam(params, "name");
+ }
+
+ @Override
+ public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException {
+ boolean show = showTagBody(getName(params));
+ if (show) {
+ renderBody(env, body);
+ }
+ }
+
+ protected abstract boolean showTagBody(String roleName);
+}
\ No newline at end of file
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/SecureTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/SecureTag.java
new file mode 100644
index 0000000..ab41b55
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/SecureTag.java
@@ -0,0 +1,44 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.core.Environment;
+import freemarker.template.*;
+import org.apache.shiro.SecurityUtils;
+import org.apache.shiro.subject.Subject;
+
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Equivalent to {@link org.apache.shiro.web.tags.SecureTag}
+ */
+public abstract class SecureTag implements TemplateDirectiveModel {
+ public void execute(Environment env, Map params, TemplateModel[] loopVars, TemplateDirectiveBody body) throws TemplateException, IOException {
+ verifyParameters(params);
+ render(env, params, body);
+ }
+
+ public abstract void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException;
+
+ protected String getParam(Map params, String name) {
+ Object value = params.get(name);
+
+ if (value instanceof SimpleScalar) {
+ return ((SimpleScalar)value).getAsString();
+ }
+
+ return null;
+ }
+
+ protected Subject getSubject() {
+ return SecurityUtils.getSubject();
+ }
+
+ protected void verifyParameters(Map params) throws TemplateModelException {
+ }
+
+ protected void renderBody(Environment env, TemplateDirectiveBody body) throws IOException, TemplateException {
+ if (body != null) {
+ body.render(env.getOut());
+ }
+ }
+}
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/ShiroTags.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/ShiroTags.java
new file mode 100644
index 0000000..7830482
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/ShiroTags.java
@@ -0,0 +1,23 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.template.SimpleHash;
+
+/**
+ * Shortcut for injecting the tags into Freemarker
+ *
+ * Usage: cfg.setSharedVeriable("shiro", new ShiroTags());
+ */
+public class ShiroTags extends SimpleHash {
+ public ShiroTags() {
+ put("authenticated", new AuthenticatedTag());
+ put("guest", new GuestTag());
+ put("hasAnyRoles", new HasAnyRolesTag());
+ put("hasPermission", new HasPermissionTag());
+ put("hasRole", new HasRoleTag());
+ put("lacksPermission", new LacksPermissionTag());
+ put("lacksRole", new LacksRoleTag());
+ put("notAuthenticated", new NotAuthenticatedTag());
+ put("principal", new PrincipalTag());
+ put("user", new UserTag());
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/krt/dairy/common/web/shiro/freemarker/UserTag.java b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/UserTag.java
new file mode 100644
index 0000000..5533a6a
--- /dev/null
+++ b/src/main/java/com/krt/dairy/common/web/shiro/freemarker/UserTag.java
@@ -0,0 +1,37 @@
+package com.krt.dairy.common.web.shiro.freemarker;
+
+import freemarker.core.Environment;
+import freemarker.log.Logger;
+import freemarker.template.TemplateDirectiveBody;
+import freemarker.template.TemplateException;
+
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Freemarker tag that renders the tag body if the current user known to the system, either from a successful login attempt
+ * (not necessarily during the current session) or from 'RememberMe' services.
+ *
+ * Note: This is less restrictive than the AuthenticatedTag since it only assumes
+ * the user is who they say they are, either via a current session login or via Remember Me services, which
+ * makes no guarantee the user is who they say they are. The AuthenticatedTag however
+ * guarantees that the current user has logged in during their current session, proving they really are
+ * who they say they are.
+ *
+ *
The logically opposite tag of this one is the {@link org.apache.shiro.web.tags.GuestTag}.
+ *
+ *
Equivalent to {@link org.apache.shiro.web.tags.UserTag}
+ */
+public class UserTag extends SecureTag {
+ static final Logger log = Logger.getLogger("UserTag");
+
+ @Override
+ public void render(Environment env, Map params, TemplateDirectiveBody body) throws IOException, TemplateException {
+ if (getSubject() != null && getSubject().getPrincipal() != null) {
+ log.debug("Subject has known identity (aka 'principal'). Tag body will be evaluated.");
+ renderBody(env, body);
+ } else {
+ log.debug("Subject does not exist or have a known identity (aka 'principal'). Tag body will not be evaluated.");
+ }
+ }
+}
diff --git a/src/main/java/com/krt/dairy/core/auth/dao/AuthUserDao.java b/src/main/java/com/krt/dairy/core/auth/dao/AuthUserDao.java
new file mode 100644
index 0000000..026655a
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/auth/dao/AuthUserDao.java
@@ -0,0 +1,71 @@
+package com.krt.dairy.core.auth.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.auth.domain.AuthUser;
+
+import java.util.List;
+
+
+public interface AuthUserDao {
+
+ /**
+ *根据id获取
+ **/
+ public AuthUser getById(Long id);
+
+ /**
+ * 根据username获取
+ */
+ public AuthUser getByUsername(String username);
+
+ /**
+ * 根据username 和 password获取
+ * @param authUser
+ * @return
+ */
+ public AuthUser getByUsernameAndPassword(AuthUser authUser);
+
+ /**
+ *获取首页推荐5个讲师
+ **/
+ public List queryRecomd();
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(AuthUser queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(AuthUser queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void createSelectivity(AuthUser entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(AuthUser entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(AuthUser entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(AuthUser entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(AuthUser entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/auth/dao/AuthUserMapper.xml b/src/main/java/com/krt/dairy/core/auth/dao/AuthUserMapper.xml
new file mode 100644
index 0000000..da4120d
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/auth/dao/AuthUserMapper.xml
@@ -0,0 +1,426 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ realname, username, password, gender, header, mobile,
+ status, birthday, education, college_code, college_name, cert_no, title, sign,
+ open_id, wechat_id, qq, login_time, ip, province,
+ city, district, weight, create_time, create_user, update_time, update_user,
+ del, id
+
+
+
+
+
+ INSERT INTO t_auth_user
+
+
+ realname,
+
+
+ username,
+
+
+ password,
+
+
+ gender,
+
+
+ header,
+
+
+ mobile,
+
+
+ status,
+
+
+ birthday,
+
+
+ education,
+
+
+ college_code,
+
+
+ college_name,
+
+
+ cert_no,
+
+
+ title,
+
+
+ sign,
+
+
+ open_id,
+
+
+ wechat_id,
+
+
+ qq,
+
+
+ login_time,
+
+
+ ip,
+
+
+ province,
+
+
+ CITY,
+
+
+ district,
+
+
+ weight,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{realname, jdbcType=VARCHAR},
+
+
+ #{username, jdbcType=VARCHAR},
+
+
+ #{password, jdbcType=VARCHAR},
+
+
+ #{gender, jdbcType=INTEGER},
+
+
+ #{header, jdbcType=VARCHAR},
+
+
+ #{mobile, jdbcType=VARCHAR},
+
+
+ #{status, jdbcType=INTEGER},
+
+
+ #{birthday, jdbcType=DATE},
+
+
+ #{education, jdbcType=VARCHAR},
+
+
+ #{collegeCode, jdbcType=VARCHAR},
+
+
+ #{collegeName, jdbcType=VARCHAR},
+
+
+ #{certNo, jdbcType=VARCHAR},
+
+
+ #{title, jdbcType=VARCHAR},
+
+
+ #{sign, jdbcType=VARCHAR},
+
+
+ #{openId, jdbcType=VARCHAR},
+
+
+ #{wechatId, jdbcType=VARCHAR},
+
+
+ #{qq, jdbcType=VARCHAR},
+
+
+ #{loginTime, jdbcType=DATE},
+
+
+ #{ip, jdbcType=VARCHAR},
+
+
+ #{province, jdbcType=VARCHAR},
+
+
+ #{city, jdbcType=VARCHAR},
+
+
+ #{district, jdbcType=VARCHAR},
+
+
+ #{weight, jdbcType=INTEGER},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UPDATE t_auth_user
+
+
+ realname = #{realname, jdbcType=VARCHAR},
+
+
+ username = #{username, jdbcType=VARCHAR},
+
+
+ password = #{password, jdbcType=VARCHAR},
+
+
+ gender = #{gender, jdbcType=INTEGER},
+
+
+ header = #{header, jdbcType=VARCHAR},
+
+
+ mobile = #{mobile, jdbcType=VARCHAR},
+
+
+ status = #{status, jdbcType=INTEGER},
+
+
+ birthday = #{birthday, jdbcType=DATE},
+
+
+ education = #{education, jdbcType=VARCHAR},
+
+
+ college_code = #{collegeCode, jdbcType=VARCHAR},
+
+
+ college_name = #{collegeName, jdbcType=VARCHAR},
+
+
+ cert_no = #{certNo, jdbcType=VARCHAR},
+
+
+ title = #{title, jdbcType=VARCHAR},
+
+
+ sign = #{sign, jdbcType=VARCHAR},
+
+
+ open_id = #{openId, jdbcType=VARCHAR},
+
+
+ wechat_id = #{wechatId, jdbcType=VARCHAR},
+
+
+ qq = #{qq, jdbcType=VARCHAR},
+
+
+ login_time = #{loginTime, jdbcType=DATE},
+
+
+ ip = #{ip, jdbcType=VARCHAR},
+
+
+ province = #{province, jdbcType=VARCHAR},
+
+
+ city = #{city, jdbcType=VARCHAR},
+
+
+ district = #{district, jdbcType=VARCHAR},
+
+
+ weight = #{weight, jdbcType=INTEGER},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+ INSERT INTO t_auth_user
+ ( realname, username, password, gender, header, mobile,
+ status, birthday, education, college_code, college_name, cert_no, title, sign,
+ open_id, wechat_id, qq, login_time, ip, province,
+ city, district, weight, create_time, create_user, update_time, update_user,
+ del, id )
+ VALUES
+ ( #{realname, jdbcType=VARCHAR}, #{username, jdbcType=VARCHAR}, #{password, jdbcType=VARCHAR}, #{gender, jdbcType=INTEGER}, #{header, jdbcType=VARCHAR}, #{mobile, jdbcType=VARCHAR},
+ #{status, jdbcType=INTEGER}, #{birthday, jdbcType=DATE}, #{education, jdbcType=VARCHAR}, #{collegeCode, jdbcType=VARCHAR}, #{collegeName, jdbcType=VARCHAR}, #{certNo, jdbcType=VARCHAR}, #{title, jdbcType=VARCHAR}, #{sign, jdbcType=VARCHAR},
+ #{openId, jdbcType=VARCHAR}, #{wechatId, jdbcType=VARCHAR}, #{qq, jdbcType=VARCHAR}, #{loginTime, jdbcType=DATE}, #{ip, jdbcType=VARCHAR}, #{province, jdbcType=VARCHAR},
+ #{city, jdbcType=VARCHAR}, #{district, jdbcType=VARCHAR} , #{weight, jdbcType=INTEGER}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP}, #{updateUser, jdbcType=VARCHAR},
+ #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ UPDATE t_auth_user SET
+ realname = #{realname, jdbcType=VARCHAR},
+ username = #{username, jdbcType=VARCHAR},
+ password = #{password, jdbcType=VARCHAR},
+ gender = #{gender, jdbcType=INTEGER},
+ header = #{header, jdbcType=VARCHAR},
+ mobile = #{mobile, jdbcType=VARCHAR},
+ status = #{status, jdbcType=INTEGER},
+ birthday = #{birthday, jdbcType=DATE},
+ education = #{education, jdbcType=VARCHAR},
+ college_code = #{collegeCode, jdbcType=VARCHAR},
+ college_name = #{collegeName, jdbcType=VARCHAR},
+ cert_no = #{certNo, jdbcType=VARCHAR},
+ title = #{title, jdbcType=VARCHAR},
+ sign = #{sign, jdbcType=VARCHAR},
+ open_id = #{openId, jdbcType=VARCHAR},
+ wechat_id = #{wechatId, jdbcType=VARCHAR},
+ qq = #{qq, jdbcType=VARCHAR},
+ login_time = #{loginTime, jdbcType=DATE},
+ ip = #{ip, jdbcType=VARCHAR},
+ province = #{province, jdbcType=VARCHAR},
+ city = #{city, jdbcType=VARCHAR},
+ district = #{district, jdbcType=VARCHAR},
+ weight = #{weight, jdbcType=INTEGER},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ DELETE
+ FROM t_auth_user
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_auth_user
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/auth/domain/AuthUser.java b/src/main/java/com/krt/dairy/core/auth/domain/AuthUser.java
new file mode 100644
index 0000000..61e1374
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/auth/domain/AuthUser.java
@@ -0,0 +1,311 @@
+package com.krt.dairy.core.auth.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+import com.krt.dairy.common.web.auth.SessionUser;
+
+import java.util.Date;
+import java.util.Set;
+
+/**
+ * 系统用户
+ */
+public class AuthUser extends BaseEntity implements SessionUser{
+
+ private static final long serialVersionUID = 94044276250229411L;
+
+ /**
+ *登录用户名
+ **/
+ private String realname;
+
+ /**
+ *真实姓名
+ **/
+ private String username;
+
+ /**
+ *密码
+ **/
+ private String password;
+
+ /**
+ *性别
+ **/
+ private Integer gender;
+
+ /**
+ *头像
+ **/
+ private String header;
+
+ /**
+ *手机号码
+ **/
+ private String mobile;
+
+ /**
+ *状态:待审核(0),审核通过(1),默认(2),审核未通过(3),禁用(5)
+ **/
+ private Integer status;
+
+ /**
+ *生日
+ **/
+ private Date birthday;
+
+ /**
+ *学历:大专、本科、硕士、博士、博士后
+ **/
+ private String education;
+
+ /**
+ * 大学编号
+ */
+ private String collegeCode;
+
+ /**
+ * 大学名称
+ */
+ private String collegeName;
+
+ /**
+ *资格证书编号
+ **/
+ private String certNo;
+
+ /**
+ *头衔
+ **/
+ private String title;
+
+ /**
+ *签名
+ **/
+ private String sign;
+
+ /**
+ *微信公众号openid
+ **/
+ private String openId;
+
+ /**
+ *微信号
+ **/
+ private String wechatId;
+
+ /**
+ *qq号
+ **/
+ private String qq;
+
+ /**
+ *最后一次登录时间
+ **/
+ private Date loginTime;
+
+ /**
+ *最后一次登录IP
+ **/
+ private String ip;
+
+ /**
+ *所在省份
+ **/
+ private String province;
+
+ /**
+ *所在城市
+ **/
+ private String city;
+
+ /**
+ *所在地区
+ **/
+ private String district;
+
+ /**
+ * 推荐权重
+ */
+ private Integer weight;
+
+ /**
+ * 扩展字段:微信昵称
+ */
+ private String nickname;
+
+ public String getRealname(){
+ return realname;
+ }
+ public void setRealname(String realname){
+ this.realname = realname;
+ }
+
+ public String getUsername(){
+ return username;
+ }
+ public void setUsername(String username){
+ this.username = username;
+ }
+
+ public String getPassword(){
+ return password;
+ }
+ public void setPassword(String password){
+ this.password = password;
+ }
+
+ public Integer getGender(){
+ return gender;
+ }
+ public void setGender(Integer gender){
+ this.gender = gender;
+ }
+
+ public String getHeader(){
+ return header;
+ }
+ public void setHeader(String header){
+ this.header = header;
+ }
+
+ public String getMobile(){
+ return mobile;
+ }
+ public void setMobile(String mobile){
+ this.mobile = mobile;
+ }
+
+ public Integer getStatus(){
+ return status;
+ }
+ public void setStatus(Integer status){
+ this.status = status;
+ }
+
+ public Date getBirthday(){
+ return birthday;
+ }
+ public void setBirthday(Date birthday){
+ this.birthday = birthday;
+ }
+
+ public String getEducation(){
+ return education;
+ }
+ public void setEducation(String education){
+ this.education = education;
+ }
+ public String getCollegeCode() {
+ return collegeCode;
+ }
+ public void setCollegeCode(String collegeCode) {
+ this.collegeCode = collegeCode;
+ }
+ public String getCollegeName() {
+ return collegeName;
+ }
+ public void setCollegeName(String collegeName) {
+ this.collegeName = collegeName;
+ }
+ public String getCertNo(){
+ return certNo;
+ }
+ public void setCertNo(String certNo){
+ this.certNo = certNo;
+ }
+
+ public String getTitle(){
+ return title;
+ }
+ public void setTitle(String title){
+ this.title = title;
+ }
+
+ public String getSign(){
+ return sign;
+ }
+ public void setSign(String sign){
+ this.sign = sign;
+ }
+
+ public String getOpenId(){
+ return openId;
+ }
+ public void setOpenId(String openId){
+ this.openId = openId;
+ }
+
+ public String getWechatId(){
+ return wechatId;
+ }
+ public void setWechatId(String wechatId){
+ this.wechatId = wechatId;
+ }
+
+ public String getQq(){
+ return qq;
+ }
+ public void setQq(String qq){
+ this.qq = qq;
+ }
+
+ public Date getLoginTime(){
+ return loginTime;
+ }
+ public void setLoginTime(Date loginTime){
+ this.loginTime = loginTime;
+ }
+
+ public String getIp(){
+ return ip;
+ }
+ public void setIp(String ip){
+ this.ip = ip;
+ }
+
+ public String getProvince(){
+ return province;
+ }
+ public void setProvince(String province){
+ this.province = province;
+ }
+
+ public String getCity(){
+ return city;
+ }
+ public void setCity(String city){
+ this.city = city;
+ }
+
+ public String getDistrict(){
+ return district;
+ }
+ public void setDistrict(String district){
+ this.district = district;
+ }
+
+ public Integer getWeight() {
+ return weight;
+ }
+ public void setWeight(Integer weight) {
+ this.weight = weight;
+ }
+
+ @Override
+ public Long getUserId() {
+ return this.getId();
+ }
+
+ @Override
+ public Set getPermissions(){
+ return null;
+ }
+ public String getNickname() {
+ return nickname;
+ }
+ public void setNickname(String nickname) {
+ this.nickname = nickname;
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/auth/service/IAuthUserService.java b/src/main/java/com/krt/dairy/core/auth/service/IAuthUserService.java
new file mode 100644
index 0000000..4cd48b1
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/auth/service/IAuthUserService.java
@@ -0,0 +1,66 @@
+package com.krt.dairy.core.auth.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.auth.domain.AuthUser;
+
+import java.util.List;
+
+
+public interface IAuthUserService {
+
+ /**
+ *根据username获取
+ **/
+ public AuthUser getByUsername(String username);
+
+ /**
+ *创建
+ **/
+ public void createSelectivity(AuthUser entity);
+
+
+
+ /**
+ *根据id获取
+ **/
+ public AuthUser getById(Long id);
+
+ /**
+ *根据username和password获取
+ **/
+ public AuthUser getByUsernameAndPassword(AuthUser authUser);
+
+ /**
+ *获取首页推荐5个讲师
+ **/
+ public List queryRecomd();
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(AuthUser queryEntity, TailPage page);
+
+ /**
+ *根据id更新
+ **/
+ public void update(AuthUser entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(AuthUser entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(AuthUser entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(AuthUser entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/auth/service/impl/AuthUserServiceImpl.java b/src/main/java/com/krt/dairy/core/auth/service/impl/AuthUserServiceImpl.java
new file mode 100644
index 0000000..bb45499
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/auth/service/impl/AuthUserServiceImpl.java
@@ -0,0 +1,90 @@
+package com.krt.dairy.core.auth.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.common.storage.QiniuStorage;
+import com.krt.dairy.core.auth.dao.AuthUserDao;
+import com.krt.dairy.core.auth.domain.AuthUser;
+import com.krt.dairy.core.auth.service.IAuthUserService;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class AuthUserServiceImpl implements IAuthUserService{
+
+ @Autowired
+ private AuthUserDao entityDao;
+
+ public void createSelectivity(AuthUser entity){
+ entityDao.createSelectivity(entity);
+ }
+
+ /**
+ *根据username获取
+ **/
+ public AuthUser getByUsername(String username){
+ return entityDao.getByUsername(username);
+ }
+
+
+
+ public AuthUser getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ /**
+ *根据username和password获取
+ **/
+ public AuthUser getByUsernameAndPassword(AuthUser authUser){
+ return entityDao.getByUsernameAndPassword(authUser);
+ }
+
+ /**
+ *获取首页推荐5个讲师
+ **/
+ public List queryRecomd(){
+ List recomdList = entityDao.queryRecomd();
+ if(CollectionUtils.isNotEmpty(recomdList)){
+ for(AuthUser item : recomdList){
+ if(StringUtils.isNotEmpty(item.getHeader())){
+ item.setHeader(QiniuStorage.getUrl(item.getHeader()));
+ }
+ }
+ }
+ return recomdList;
+ }
+
+ public TailPage queryPage(AuthUser queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+
+
+ public void update(AuthUser entity){
+ entityDao.update(entity);
+ }
+
+ public void updateSelectivity(AuthUser entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ public void delete(AuthUser entity){
+ entityDao.delete(entity);
+ }
+
+ public void deleteLogic(AuthUser entity){
+ entityDao.deleteLogic(entity);
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/CourseEnum.java b/src/main/java/com/krt/dairy/core/consts/CourseEnum.java
new file mode 100644
index 0000000..576f2d0
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/CourseEnum.java
@@ -0,0 +1,25 @@
+package com.krt.dairy.core.consts;
+
+/**
+ * 课程使用的枚举
+ */
+public enum CourseEnum {
+
+ FREE(1), //免费
+ FREE_NOT(0), //收费
+
+ ONSALE(1), //上架
+ ONSALE_NOT(0), //下架
+
+ COLLECTION_CLASSIFY_COURSE(1);//课程收藏
+
+
+ private Integer value;
+ private CourseEnum(Integer value) {
+ this.value = value;
+ }
+
+ public Integer value(){
+ return value;
+ }
+}
diff --git a/src/main/java/com/krt/dairy/core/consts/dao/ConstsClassifyDao.java b/src/main/java/com/krt/dairy/core/consts/dao/ConstsClassifyDao.java
new file mode 100644
index 0000000..f704efa
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/dao/ConstsClassifyDao.java
@@ -0,0 +1,77 @@
+package com.krt.dairy.core.consts.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.consts.domain.ConstsClassify;
+import com.krt.dairy.core.consts.domain.ConstsCollege;
+
+import java.util.List;
+
+
+public interface ConstsClassifyDao {
+
+ /**
+ *根据id获取
+ **/
+ public ConstsClassify getById(Long id);
+
+ /**
+ * 根据code获取
+ */
+ public ConstsCollege getByCode(String code);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll();
+
+ /**
+ * 根据条件动态获取
+ * @param queryEntity
+ * @return
+ */
+ public List queryByCondition(ConstsClassify queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(ConstsClassify queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(ConstsClassify queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void create(ConstsClassify entity);
+
+ /**
+ * 创建新记录
+ */
+ public void createSelectivity(ConstsClassify entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(ConstsClassify entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(ConstsClassify entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(ConstsClassify entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(ConstsClassify entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/dao/ConstsClassifyMapper.xml b/src/main/java/com/krt/dairy/core/consts/dao/ConstsClassifyMapper.xml
new file mode 100644
index 0000000..6c59291
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/dao/ConstsClassifyMapper.xml
@@ -0,0 +1,196 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name, code, parent_code, sort, create_time, create_user, update_time,
+ update_user, del, id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_consts_classify
+ ( name, parent_code, sort, create_time, create_user, update_time,
+ update_user, del, id )
+ VALUES
+ ( #{name, jdbcType=VARCHAR}, #{parentCode, jdbcType=VARCHAR}, #{sort, jdbcType=VARCHAR}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP},
+ #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ INSERT INTO t_consts_classify
+
+
+ name,
+
+
+ CODE,
+
+
+ parent_code,
+
+
+ sort,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{name, jdbcType=VARCHAR},
+
+
+ #{code, jdbcType=VARCHAR},
+
+
+ #{parentCode, jdbcType=VARCHAR},
+
+
+ #{sort, jdbcType=INTEGER},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_consts_classify SET
+ name = #{name, jdbcType=VARCHAR},
+ parent_code = #{parentCode, jdbcType=VARCHAR},
+ sort = #{sort, jdbcType=VARCHAR},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_consts_classify
+
+
+ name = #{name, jdbcType=VARCHAR},
+
+
+ parent_code = #{parentCode, jdbcType=VARCHAR},
+
+
+ sort = #{sort, jdbcType=VARCHAR},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE FROM t_consts_classify
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_consts_classify
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/consts/dao/ConstsCollegeDao.java b/src/main/java/com/krt/dairy/core/consts/dao/ConstsCollegeDao.java
new file mode 100644
index 0000000..b2d16e5
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/dao/ConstsCollegeDao.java
@@ -0,0 +1,67 @@
+package com.krt.dairy.core.consts.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.consts.domain.ConstsCollege;
+
+import java.util.List;
+
+
+public interface ConstsCollegeDao {
+
+ /**
+ *根据id获取
+ **/
+ public ConstsCollege getById(Long id);
+
+ /**
+ * 根据code获取
+ */
+ public ConstsCollege getByCode(String code);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(ConstsCollege queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(ConstsCollege queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(ConstsCollege queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void create(ConstsCollege entity);
+
+ /**
+ * 创建网校
+ */
+ public void createSelectivity(ConstsCollege entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(ConstsCollege entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(ConstsCollege entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(ConstsCollege entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(ConstsCollege entity);
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/dao/ConstsCollegeMapper.xml b/src/main/java/com/krt/dairy/core/consts/dao/ConstsCollegeMapper.xml
new file mode 100644
index 0000000..3ef59fd
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/dao/ConstsCollegeMapper.xml
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name, code, picture, create_time, create_user, update_time,
+ update_user, del, id
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_consts_college
+ ( name, code, picture, create_time, create_user, update_time,
+ update_user, del, id )
+ VALUES
+ ( #{name, jdbcType=VARCHAR}, #{code, jdbcType=VARCHAR}, #{picture, jdbcType=VARCHAR}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP},
+ #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ INSERT INTO t_consts_college
+
+
+ name,
+
+
+ code,
+
+
+ picture,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{name, jdbcType=VARCHAR},
+
+
+ #{code, jdbcType=VARCHAR},
+
+
+ #{picture, jdbcType=VARCHAR},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_consts_college SET
+ name = #{name, jdbcType=VARCHAR},
+ code = #{code, jdbcType=VARCHAR},
+ picture = #{picture, jdbcType=VARCHAR},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_consts_college
+
+
+ name = #{name, jdbcType=VARCHAR},
+
+
+ code = #{code, jdbcType=VARCHAR},
+
+
+ picture = #{picture, jdbcType=VARCHAR},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE FROM t_consts_college
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_consts_college
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/consts/dao/ConstsSiteCarouselDao.java b/src/main/java/com/krt/dairy/core/consts/dao/ConstsSiteCarouselDao.java
new file mode 100644
index 0000000..0032216
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/dao/ConstsSiteCarouselDao.java
@@ -0,0 +1,69 @@
+package com.krt.dairy.core.consts.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.consts.domain.ConstsSiteCarousel;
+
+import java.util.List;
+
+
+public interface ConstsSiteCarouselDao {
+
+ /**
+ *根据id获取
+ **/
+ public ConstsSiteCarousel getById(Long id);
+
+ /**
+ * 获取轮播
+ */
+ public List queryCarousels(Integer count);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(ConstsSiteCarousel queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(ConstsSiteCarousel queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(ConstsSiteCarousel queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void create(ConstsSiteCarousel entity);
+
+ /**
+ * 创建新记录
+ */
+ public void createSelectivity(ConstsSiteCarousel entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(ConstsSiteCarousel entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(ConstsSiteCarousel entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(ConstsSiteCarousel entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(ConstsSiteCarousel entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/dao/ConstsSiteCarouselMapper.xml b/src/main/java/com/krt/dairy/core/consts/dao/ConstsSiteCarouselMapper.xml
new file mode 100644
index 0000000..7bfa77b
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/dao/ConstsSiteCarouselMapper.xml
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name, picture, url, weight, enable, create_time, create_user,
+ update_time, update_user, del, id
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_consts_site_carousel
+ ( name, picture, url, weight, enable, create_time, create_user,
+ update_time, update_user, del, id )
+ VALUES
+ ( #{name, jdbcType=VARCHAR}, #{picture, jdbcType=VARCHAR}, #{url, jdbcType=VARCHAR}, #{weight, jdbcType=INTEGER}, #{enable, jdbcType=TINYINT}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR},
+ #{updateTime, jdbcType=TIMESTAMP}, #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT}, #{id, jdbcType=INTEGER} )
+
+
+
+ UPDATE t_consts_site_carousel SET
+ name = #{name, jdbcType=VARCHAR},
+ picture = #{picture, jdbcType=VARCHAR},
+ url = #{url, jdbcType=VARCHAR},
+ weight = #{weight, jdbcType=INTEGER},
+ enable = #{enable, jdbcType=TINYINT},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ INSERT INTO t_consts_site_carousel
+
+
+ name,
+
+
+ picture,
+
+
+ url,
+
+
+ weight,
+
+
+ enable,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{name, jdbcType=VARCHAR},
+
+
+ #{picture, jdbcType=VARCHAR},
+
+
+ #{url, jdbcType=VARCHAR},
+
+
+ #{weight, jdbcType=INTEGER},
+
+
+ #{enable, jdbcType=INTEGER},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_consts_site_carousel
+
+
+ name = #{name, jdbcType=VARCHAR},
+
+
+ picture = #{picture, jdbcType=VARCHAR},
+
+
+ url = #{url, jdbcType=VARCHAR},
+
+
+ weight = #{weight, jdbcType=INTEGER},
+
+
+ enable = #{enable, jdbcType=TINYINT},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE FROM t_consts_site_carousel
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_consts_site_carousel
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/consts/domain/ConstsClassify.java b/src/main/java/com/krt/dairy/core/consts/domain/ConstsClassify.java
new file mode 100644
index 0000000..34db656
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/domain/ConstsClassify.java
@@ -0,0 +1,57 @@
+package com.krt.dairy.core.consts.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+public class ConstsClassify extends BaseEntity{
+
+ private static final long serialVersionUID = -7695989855010913861L;
+
+ /**
+ *名称
+ **/
+ private String name;
+
+ /**
+ *编码
+ **/
+ private String code;
+
+ /**
+ *父级别id
+ **/
+ private String parentCode;
+
+ /**
+ *排序
+ **/
+ private Long sort;
+
+ public String getName(){
+ return name;
+ }
+ public void setName(String name){
+ this.name = name;
+ }
+ public String getCode() {
+ return code;
+ }
+ public void setCode(String code) {
+ this.code = code;
+ }
+ public String getParentCode() {
+ return parentCode;
+ }
+ public void setParentCode(String parentCode) {
+ this.parentCode = parentCode;
+ }
+ public Long getSort(){
+ return sort;
+ }
+ public void setSort(Long sort){
+ this.sort = sort;
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/domain/ConstsCollege.java b/src/main/java/com/krt/dairy/core/consts/domain/ConstsCollege.java
new file mode 100644
index 0000000..417810d
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/domain/ConstsCollege.java
@@ -0,0 +1,48 @@
+package com.krt.dairy.core.consts.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+public class ConstsCollege extends BaseEntity{
+
+ private static final long serialVersionUID = -7643904360103197835L;
+
+ /**
+ *名称
+ **/
+ private String name;
+
+ /**
+ *编码
+ **/
+ private String code;
+
+ /**
+ *图片
+ **/
+ private String picture;
+
+ public String getName(){
+ return name;
+ }
+ public void setName(String name){
+ this.name = name;
+ }
+
+ public String getCode(){
+ return code;
+ }
+ public void setCode(String code){
+ this.code = code;
+ }
+
+ public String getPicture(){
+ return picture;
+ }
+ public void setPicture(String picture){
+ this.picture = picture;
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/domain/ConstsSiteCarousel.java b/src/main/java/com/krt/dairy/core/consts/domain/ConstsSiteCarousel.java
new file mode 100644
index 0000000..c25d9c3
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/domain/ConstsSiteCarousel.java
@@ -0,0 +1,71 @@
+package com.krt.dairy.core.consts.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+
+public class ConstsSiteCarousel extends BaseEntity{
+
+ private static final long serialVersionUID = -68528406716367757L;
+
+ /**
+ *名称
+ **/
+ private String name;
+
+ /**
+ *图片
+ **/
+ private String picture;
+
+ /**
+ *链接
+ **/
+ private String url;
+
+ /**
+ *权重
+ **/
+ private Integer weight;
+
+ /**
+ * 是否可用
+ */
+ private Integer enable;
+
+
+ public String getName(){
+ return name;
+ }
+ public void setName(String name){
+ this.name = name;
+ }
+
+ public String getPicture(){
+ return picture;
+ }
+ public void setPicture(String picture){
+ this.picture = picture;
+ }
+
+ public String getUrl(){
+ return url;
+ }
+ public void setUrl(String url){
+ this.url = url;
+ }
+
+ public Integer getWeight(){
+ return weight;
+ }
+ public void setWeight(Integer weight){
+ this.weight = weight;
+ }
+ public Integer getEnable() {
+ return enable;
+ }
+ public void setEnable(Integer enable) {
+ this.enable = enable;
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/service/IConstsClassifyService.java b/src/main/java/com/krt/dairy/core/consts/service/IConstsClassifyService.java
new file mode 100644
index 0000000..d388d06
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/service/IConstsClassifyService.java
@@ -0,0 +1,64 @@
+package com.krt.dairy.core.consts.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.consts.domain.ConstsClassify;
+
+import java.util.List;
+
+
+public interface IConstsClassifyService {
+
+ /**
+ *根据id获取
+ **/
+ public ConstsClassify getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll();
+
+ /**
+ * 根据code获取
+ */
+ public ConstsClassify getByCode(String code);
+
+ /**
+ *根据条件动态获取
+ **/
+ public List queryByCondition(ConstsClassify queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(ConstsClassify queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void create(ConstsClassify entity);
+
+ /**
+ * 创建
+ */
+ public void createSelectivity(ConstsClassify entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(ConstsClassify entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(ConstsClassify entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(ConstsClassify entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/service/IConstsCollegeService.java b/src/main/java/com/krt/dairy/core/consts/service/IConstsCollegeService.java
new file mode 100644
index 0000000..0512a61
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/service/IConstsCollegeService.java
@@ -0,0 +1,64 @@
+package com.krt.dairy.core.consts.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.consts.domain.ConstsCollege;
+
+import java.util.List;
+
+
+public interface IConstsCollegeService {
+
+ /**
+ *根据id获取
+ **/
+ public ConstsCollege getById(Long id);
+
+ /**
+ * 根据code获取
+ */
+ public ConstsCollege getByCode(String code);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(ConstsCollege queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(ConstsCollege queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void create(ConstsCollege entity);
+
+ /**
+ * 创建网校
+ */
+ public void createSelectivity(ConstsCollege entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(ConstsCollege entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(ConstsCollege entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(ConstsCollege entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(ConstsCollege entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/service/IConstsSiteCarouselService.java b/src/main/java/com/krt/dairy/core/consts/service/IConstsSiteCarouselService.java
new file mode 100644
index 0000000..27845b1
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/service/IConstsSiteCarouselService.java
@@ -0,0 +1,59 @@
+package com.krt.dairy.core.consts.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.consts.domain.ConstsSiteCarousel;
+
+import java.util.List;
+
+
+public interface IConstsSiteCarouselService {
+
+ /**
+ *根据id获取
+ **/
+ public ConstsSiteCarousel getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryCarousels(Integer count);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(ConstsSiteCarousel queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void create(ConstsSiteCarousel entity);
+
+ /**
+ * 创建新记录
+ */
+ public void createSelectivity(ConstsSiteCarousel entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(ConstsSiteCarousel entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(ConstsSiteCarousel entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(ConstsSiteCarousel entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(ConstsSiteCarousel entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsClassifyServiceImpl.java b/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsClassifyServiceImpl.java
new file mode 100644
index 0000000..e5c2664
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsClassifyServiceImpl.java
@@ -0,0 +1,81 @@
+package com.krt.dairy.core.consts.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.consts.dao.ConstsClassifyDao;
+import com.krt.dairy.core.consts.domain.ConstsClassify;
+import com.krt.dairy.core.consts.service.IConstsClassifyService;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class ConstsClassifyServiceImpl implements IConstsClassifyService{
+
+ @Autowired
+ private ConstsClassifyDao entityDao;
+
+ public ConstsClassify getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ public List queryAll(){
+ return entityDao.queryAll();
+ }
+
+ @Override
+ public List queryByCondition(ConstsClassify queryEntity){
+ return entityDao.queryByCondition(queryEntity);
+ }
+
+ @Override
+ public ConstsClassify getByCode(String code){
+ if(StringUtils.isEmpty(code))
+ return null;
+ ConstsClassify queryEntity = new ConstsClassify();
+ queryEntity.setCode(code);
+ List list = entityDao.queryByCondition(queryEntity);
+ if(CollectionUtils.isNotEmpty(list))
+ return list.get(0);
+ return null;
+ }
+
+ public TailPage queryPage(ConstsClassify queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ @Override
+ public void create(ConstsClassify entity){
+ entityDao.create(entity);
+ }
+
+ @Override
+ public void createSelectivity(ConstsClassify entity){
+ entityDao.createSelectivity(entity);
+ }
+
+ @Override
+ public void updateSelectivity(ConstsClassify entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ @Override
+ public void delete(ConstsClassify entity){
+ entityDao.delete(entity);
+ }
+
+ @Override
+ public void deleteLogic(ConstsClassify entity){
+ entityDao.deleteLogic(entity);
+ }
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsCollegeServiceImpl.java b/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsCollegeServiceImpl.java
new file mode 100644
index 0000000..9ddfae9
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsCollegeServiceImpl.java
@@ -0,0 +1,76 @@
+package com.krt.dairy.core.consts.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.consts.dao.ConstsCollegeDao;
+import com.krt.dairy.core.consts.domain.ConstsCollege;
+import com.krt.dairy.core.consts.service.IConstsCollegeService;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class ConstsCollegeServiceImpl implements IConstsCollegeService{
+
+ @Autowired
+ private ConstsCollegeDao entityDao;
+
+ /**
+ * 根据id获取
+ */
+ public ConstsCollege getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ /**
+ * 根据code获取
+ */
+ public ConstsCollege getByCode(String code){
+ return entityDao.getByCode(code);
+ }
+
+ public List queryAll(ConstsCollege queryEntity){
+ return entityDao.queryAll(queryEntity);
+ }
+
+ public TailPage queryPage(ConstsCollege queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ public void create(ConstsCollege entity){
+ entityDao.create(entity);
+ }
+
+ /**
+ * 创建网校
+ */
+ public void createSelectivity(ConstsCollege entity){
+ this.entityDao.createSelectivity(entity);
+ }
+
+ public void update(ConstsCollege entity){
+ entityDao.update(entity);
+ }
+
+ public void updateSelectivity(ConstsCollege entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ public void delete(ConstsCollege entity){
+ entityDao.delete(entity);
+ }
+
+ public void deleteLogic(ConstsCollege entity){
+ entityDao.deleteLogic(entity);
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsSiteCarouselServiceImpl.java b/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsSiteCarouselServiceImpl.java
new file mode 100644
index 0000000..3f5bd68
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/consts/service/impl/ConstsSiteCarouselServiceImpl.java
@@ -0,0 +1,86 @@
+package com.krt.dairy.core.consts.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.common.storage.QiniuStorage;
+import com.krt.dairy.core.consts.dao.ConstsSiteCarouselDao;
+import com.krt.dairy.core.consts.domain.ConstsSiteCarousel;
+import com.krt.dairy.core.consts.service.IConstsSiteCarouselService;
+import org.apache.commons.collections.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class ConstsSiteCarouselServiceImpl implements IConstsSiteCarouselService{
+
+ @Autowired
+ private ConstsSiteCarouselDao entityDao;
+
+ @Override
+ public ConstsSiteCarousel getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ @Override
+ public List queryCarousels(Integer count){
+ List resultList = entityDao.queryCarousels(count);
+ //处理为七牛图片链接
+ for(ConstsSiteCarousel item : resultList){
+ item.setPicture(QiniuStorage.getUrl(item.getPicture()));
+ }
+ return resultList;
+ }
+
+ @Override
+ public TailPage queryPage(ConstsSiteCarousel queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ if(CollectionUtils.isNotEmpty(items)){
+ for(ConstsSiteCarousel item : items){
+ String pictureUrl = QiniuStorage.getUrl(item.getPicture());//处理图片
+ item.setPicture(pictureUrl);
+ }
+ }
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ @Override
+ public void create(ConstsSiteCarousel entity){
+ entityDao.create(entity);
+ }
+
+ /**
+ * 创建新记录
+ */
+ public void createSelectivity(ConstsSiteCarousel entity){
+ this.entityDao.createSelectivity(entity);
+ }
+
+ @Override
+ public void update(ConstsSiteCarousel entity){
+ entityDao.update(entity);
+ }
+
+ @Override
+ public void updateSelectivity(ConstsSiteCarousel entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ @Override
+ public void delete(ConstsSiteCarousel entity){
+ entityDao.delete(entity);
+ }
+
+ @Override
+ public void deleteLogic(ConstsSiteCarousel entity){
+ entityDao.deleteLogic(entity);
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/dao/CourseCommentDao.java b/src/main/java/com/krt/dairy/core/course/dao/CourseCommentDao.java
new file mode 100644
index 0000000..b5c2354
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/dao/CourseCommentDao.java
@@ -0,0 +1,75 @@
+package com.krt.dairy.core.course.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.course.domain.CourseComment;
+
+import java.util.List;
+
+
+public interface CourseCommentDao {
+
+ /**
+ *根据id获取
+ **/
+ public CourseComment getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(CourseComment queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(CourseComment queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(CourseComment queryEntity, TailPage page);
+
+
+ /**
+ *获取总数量
+ **/
+ public Integer getMyQAItemsCount(CourseComment queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryMyQAItemsPage(CourseComment queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void create(CourseComment entity);
+
+ /**
+ * 创建新记录
+ */
+ public void createSelectivity(CourseComment entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(CourseComment entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(CourseComment entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(CourseComment entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(CourseComment entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/dao/CourseCommentMapper.xml b/src/main/java/com/krt/dairy/core/course/dao/CourseCommentMapper.xml
new file mode 100644
index 0000000..4fda32a
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/dao/CourseCommentMapper.xml
@@ -0,0 +1,286 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ username, to_username, course_id, section_id, section_title, content,
+ ref_id, ref_content, type, create_time, create_user, update_time,
+ update_user, del, id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_course_comment
+ ( username, to_username, course_id, section_id, SECTION_TITLE, content,
+ ref_id, ref_content, type, create_time, create_user, update_time,
+ update_user, del, id )
+ VALUES
+ ( #{username, jdbcType=VARCHAR}, #{toUsername, jdbcType=VARCHAR}, #{courseId, jdbcType=VARCHAR}, #{sectionId, jdbcType=VARCHAR}, #{sectionTitle, jdbcType=VARCHAR}, #{content, jdbcType=VARCHAR},
+ #{refId, jdbcType=VARCHAR}, #{refContent, jdbcType=VARCHAR}, #{type, jdbcType=INTEGER}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP},
+ #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ INSERT INTO t_course_comment
+
+
+ username,
+
+
+ to_username,
+
+
+ course_id,
+
+
+ section_id,
+
+
+ SECTION_TITLE,
+
+
+ content,
+
+
+ ref_id,
+
+
+ ref_content,
+
+
+ type,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{username, jdbcType=VARCHAR},
+
+
+ #{toUsername, jdbcType=VARCHAR},
+
+
+ #{courseId, jdbcType=INTEGER},
+
+
+ #{sectionId, jdbcType=INTEGER},
+
+
+ #{sectionTitle, jdbcType=VARCHAR},
+
+
+ #{content, jdbcType=VARCHAR},
+
+
+ #{refId, jdbcType=INTEGER},
+
+
+ #{refContent, jdbcType=VARCHAR},
+
+
+ #{type, jdbcType=INTEGER},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_course_comment SET
+ username = #{username, jdbcType=VARCHAR},
+ to_username = #{toUsername, jdbcType=VARCHAR},
+ course_id = #{courseId, jdbcType=VARCHAR},
+ section_id = #{sectionId, jdbcType=VARCHAR},
+ SECTION_TITLE = #{sectionTitle, jdbcType=VARCHAR},
+ content = #{content, jdbcType=VARCHAR},
+ ref_id = #{refId, jdbcType=VARCHAR},
+ ref_content = #{refContent, jdbcType=VARCHAR},
+ type = #{type, jdbcType=INTEGER},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_course_comment
+
+
+ username = #{username, jdbcType=VARCHAR},
+
+
+ to_username = #{toUsername, jdbcType=VARCHAR},
+
+
+ course_id = #{courseId, jdbcType=VARCHAR},
+
+
+ section_id = #{sectionId, jdbcType=VARCHAR},
+
+
+ section_title = #{sectionTitle, jdbcType=VARCHAR},
+
+
+ content = #{content, jdbcType=VARCHAR},
+
+
+ ref_id = #{refId, jdbcType=VARCHAR},
+
+
+ ref_content = #{refContent, jdbcType=VARCHAR},
+
+
+ type = #{type, jdbcType=INTEGER},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE FROM t_course_comment
+ WHERE id = #{id, jdbcType=INTEGER}
+ OR ref_id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_course_comment
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+ OR ref_id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/course/dao/CourseDao.java b/src/main/java/com/krt/dairy/core/course/dao/CourseDao.java
new file mode 100644
index 0000000..f2860db
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/dao/CourseDao.java
@@ -0,0 +1,62 @@
+package com.krt.dairy.core.course.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.course.domain.Course;
+import com.krt.dairy.core.course.domain.CourseQueryDto;
+
+import java.util.List;
+
+
+public interface CourseDao {
+
+ /**
+ *根据id获取
+ **/
+ public Course getById(Long id);
+
+ /**
+ *根据条件获取所有,
+ *queryEntity:查询条件;
+ **/
+ public List queryList(CourseQueryDto queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(Course queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(Course queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void create(Course entity);
+ public void createSelectivity(Course entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(Course entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(Course entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(Course entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(Course entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/dao/CourseMapper.xml b/src/main/java/com/krt/dairy/core/course/dao/CourseMapper.xml
new file mode 100644
index 0000000..2527f63
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/dao/CourseMapper.xml
@@ -0,0 +1,401 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ name, type, classify, classify_name, sub_classify, sub_classify_name, direction, username,
+ level, free, price, time, onsale, brief, picture,
+ recommend, weight, study_count, create_time, create_user, update_time,
+ update_user, del, id
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_course
+
+
+ name,
+
+
+ type,
+
+
+ classify,
+
+
+ classify_name,
+
+
+ sub_classify,
+
+
+ sub_classify_name,
+
+
+ direction,
+
+
+ username,
+
+
+ level,
+
+
+ free,
+
+
+ price,
+
+
+ time,
+
+
+ onsale,
+
+
+ brief,
+
+
+ picture,
+
+
+ recommend,
+
+
+ weight,
+
+
+ study_count,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{name, jdbcType=VARCHAR},
+
+
+ #{type, jdbcType=VARCHAR},
+
+
+ #{classify, jdbcType=VARCHAR},
+
+
+ #{classifyName, jdbcType=VARCHAR},
+
+
+ #{subClassify, jdbcType=VARCHAR},
+
+
+ #{subClassifyName, jdbcType=VARCHAR},
+
+
+ #{direction, jdbcType=VARCHAR},
+
+
+ #{username, jdbcType=INTEGER},
+
+
+ #{level, jdbcType=INTEGER},
+
+
+ #{free, jdbcType=INTEGER},
+
+
+ #{price, jdbcType=DECIMAL},
+
+
+ #{time, jdbcType=VARCHAR},
+
+
+ #{onsale, jdbcType=INTEGER},
+
+
+ #{brief, jdbcType=VARCHAR},
+
+
+ #{picture, jdbcType=VARCHAR},
+
+
+ #{recommend, jdbcType=INTEGER},
+
+
+ #{weight, jdbcType=INTEGER},
+
+
+ #{studyCount, jdbcType=INTEGER},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_course
+
+
+ name = #{name, jdbcType=VARCHAR},
+
+
+ type = #{type, jdbcType=VARCHAR},
+
+
+ classify = #{classify, jdbcType=VARCHAR},
+
+
+ classify_name = #{classifyName, jdbcType=VARCHAR},
+
+
+ sub_classify = #{subClassify, jdbcType=VARCHAR},
+
+
+ sub_classify_name = #{subClassifyName, jdbcType=VARCHAR},
+
+
+ direction = #{direction, jdbcType=VARCHAR},
+
+
+ username = #{username, jdbcType=VARCHAR},
+
+
+ level = #{level, jdbcType=INTEGER},
+
+
+ free = #{free, jdbcType=INTEGER},
+
+
+ price = #{price, jdbcType=VARCHAR},
+
+
+ time = #{time, jdbcType=VARCHAR},
+
+
+ onsale = #{onsale, jdbcType=INTEGER},
+
+
+ brief = #{brief, jdbcType=VARCHAR},
+
+
+ picture = #{picture, jdbcType=VARCHAR},
+
+
+ recommend = #{recommend, jdbcType=INTEGER},
+
+
+ weight = #{weight, jdbcType=INTEGER},
+
+
+ study_count = #{studyCount, jdbcType=INTEGER},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+ INSERT INTO t_course
+ ( name, type, classify, classify_name, sub_classify, sub_classify_name, direction, username,
+ level, free, price, time, onsale, brief, picture,
+ recommend, weight, study_count, create_time, create_user, update_time,
+ update_user, del, id )
+ VALUES
+ ( #{name, jdbcType=VARCHAR}, #{type, jdbcType=VARCHAR}, #{classify, jdbcType=VARCHAR}, #{classifyName, jdbcType=VARCHAR}, #{subClassify, jdbcType=VARCHAR}, #{subClassifyName, jdbcType=VARCHAR}, #{direction, jdbcType=VARCHAR}, #{username, jdbcType=VARCHAR},
+ #{level, jdbcType=INTEGER}, #{free, jdbcType=INTEGER}, #{price, jdbcType=VARCHAR}, #{time, jdbcType=VARCHAR}, #{onsale, jdbcType=INTEGER}, #{brief, jdbcType=VARCHAR}, #{picture, jdbcType=VARCHAR},
+ #{recommend, jdbcType=INTEGER}, #{weight, jdbcType=INTEGER}, #{studyCount, jdbcType=INTEGER}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP},
+ #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ UPDATE t_course SET
+ name = #{name, jdbcType=VARCHAR},
+ type = #{type, jdbcType=VARCHAR},
+ classify = #{classify, jdbcType=VARCHAR},
+ classify_name = #{classifyName, jdbcType=VARCHAR},
+ sub_classify = #{subClassify, jdbcType=VARCHAR},
+ sub_classify_name = #{subClassifyName, jdbcType=VARCHAR},
+ direction = #{direction, jdbcType=VARCHAR},
+ USERNAME = #{username, jdbcType=VARCHAR},
+ level = #{level, jdbcType=INTEGER},
+ free = #{free, jdbcType=INTEGER},
+ price = #{price, jdbcType=VARCHAR},
+ time = #{time, jdbcType=VARCHAR},
+ onsale = #{onsale, jdbcType=INTEGER},
+ brief = #{brief, jdbcType=VARCHAR},
+ picture = #{picture, jdbcType=VARCHAR},
+ recommend = #{recommend, jdbcType=INTEGER},
+ weight = #{weight, jdbcType=INTEGER},
+ study_count = #{studyCount, jdbcType=INTEGER},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ DELETE
+ FROM t_course
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_course
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/course/dao/CourseSectionDao.java b/src/main/java/com/krt/dairy/core/course/dao/CourseSectionDao.java
new file mode 100644
index 0000000..83c121b
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/dao/CourseSectionDao.java
@@ -0,0 +1,92 @@
+package com.krt.dairy.core.course.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.course.domain.CourseSection;
+
+import java.util.List;
+
+
+public interface CourseSectionDao {
+
+ /**
+ *根据id获取
+ **/
+ public CourseSection getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(CourseSection queryEntity);
+
+ /**
+ *
+ */
+ public Integer getMaxSort(Long courseId);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(CourseSection queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(CourseSection queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void createSelectivity(CourseSection entity);
+
+ /**
+ * 批量创建
+ */
+ public void createList(List entityList);
+
+ /**
+ *根据id更新
+ **/
+ public void update(CourseSection entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(CourseSection entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(CourseSection entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(CourseSection entity);
+
+ /**
+ *物理删除课程对应的章节
+ **/
+ public void deleteByCourseId(CourseSection entity);
+
+ /**
+ *逻辑删除课程对应的章节
+ **/
+ public void deleteLogicByCourseId(CourseSection entity);
+
+
+ /**
+ * 比当前sort大的,正序排序的第一个
+ * @param curCourseSection
+ * @return
+ */
+ public CourseSection getSortSectionMax(CourseSection curCourseSection);
+
+ /**
+ * 比当前sort小的,倒序排序的第一个
+ * @param curCourseSection
+ * @return
+ */
+ public CourseSection getSortSectionMin(CourseSection curCourseSection);
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/dao/CourseSectionMapper.xml b/src/main/java/com/krt/dairy/core/course/dao/CourseSectionMapper.xml
new file mode 100644
index 0000000..a184459
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/dao/CourseSectionMapper.xml
@@ -0,0 +1,273 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ course_id, parent_id, name, sort, time, onsale, video_url,
+ create_time, create_user, update_time, update_user, del, id
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_course_section
+ ( course_id, parent_id, name, sort, time, onsale, video_url,
+ CREATE_TIME, CREATE_USER, update_time, update_user, del, id )
+ VALUES
+ ( #{courseId, jdbcType=VARCHAR}, #{parentId, jdbcType=VARCHAR}, #{name, jdbcType=VARCHAR}, #{sort, jdbcType=INTEGER}, #{time, jdbcType=VARCHAR}, #{onsale, jdbcType=INTEGER}, #{videoUrl, jdbcType=VARCHAR},
+ #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP}, #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ INSERT INTO t_course_section
+
+
+ course_id,
+
+
+ parent_id,
+
+
+ name,
+
+
+ sort,
+
+
+ time,
+
+
+ onsale,
+
+
+ video_url,
+
+
+ CREATE_TIME,
+
+
+ CREATE_USER,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{courseId, jdbcType=INTEGER},
+
+
+ #{parentId, jdbcType=INTEGER},
+
+
+ #{name, jdbcType=VARCHAR},
+
+
+ #{sort, jdbcType=INTEGER},
+
+
+ #{time, jdbcType=VARCHAR},
+
+
+ #{onsale, jdbcType=INTEGER},
+
+
+ #{videoUrl, jdbcType=VARCHAR},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ INSERT INTO t_course_section
+ ( course_id, parent_id, name, sort, time, onsale, video_url,
+ CREATE_TIME, CREATE_USER, update_time, update_user, del )
+ VALUES
+
+ ( #{item.courseId, jdbcType=VARCHAR}, #{item.parentId, jdbcType=VARCHAR}, #{item.name, jdbcType=VARCHAR}, #{item.sort, jdbcType=INTEGER}, #{item.time, jdbcType=VARCHAR}, #{item.onsale, jdbcType=INTEGER}, #{item.videoUrl, jdbcType=VARCHAR},
+ #{item.createTime, jdbcType=DATE}, #{item.createUser, jdbcType=VARCHAR}, #{item.updateTime, jdbcType=TIMESTAMP}, #{item.updateUser, jdbcType=VARCHAR}, #{item.del, jdbcType=TINYINT})
+
+
+
+
+ UPDATE t_course_section SET
+ course_id = #{courseId, jdbcType=VARCHAR},
+ parent_id = #{parentId, jdbcType=VARCHAR},
+ name = #{name, jdbcType=VARCHAR},
+ sort = #{sort, jdbcType=INTEGER},
+ time = #{time, jdbcType=VARCHAR},
+ onsale = #{onsale, jdbcType=INTEGER},
+ video_url = #{videoUrl, jdbcType=VARCHAR},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_course_section
+
+
+ course_id = #{courseId, jdbcType=VARCHAR},
+
+
+ parent_id = #{parentId, jdbcType=VARCHAR},
+
+
+ name = #{name, jdbcType=VARCHAR},
+
+
+ sort = #{sort, jdbcType=INTEGER},
+
+
+ time = #{time, jdbcType=VARCHAR},
+
+
+ onsale = #{onsale, jdbcType=INTEGER},
+
+
+ video_url = #{videoUrl, jdbcType=VARCHAR},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE FROM t_course_section
+ WHERE id = #{id, jdbcType=INTEGER}
+ OR parent_id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_course_section
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+ OR parent_id = #{id, jdbcType=INTEGER}
+
+
+
+ DELETE FROM t_course_section
+ WHERE course_id = #{courseId, jdbcType=INTEGER}
+
+
+
+ UPDATE t_course_section
+ SET del = 1
+ WHERE course_id = #{courseId, jdbcType=INTEGER}
+
+
+
+
+
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/course/domain/Course.java b/src/main/java/com/krt/dairy/core/course/domain/Course.java
new file mode 100644
index 0000000..4826bc4
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/domain/Course.java
@@ -0,0 +1,225 @@
+package com.krt.dairy.core.course.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+import java.math.BigDecimal;
+
+
+public class Course extends BaseEntity{
+
+ private static final long serialVersionUID = -935786327879089574L;
+
+ /**
+ *课程名称
+ **/
+ private String name;
+
+ /**
+ *课程类型
+ **/
+ private String type;
+
+ /**
+ *课程分类
+ **/
+ private String classify;
+
+ /**
+ * 课程分类名称
+ */
+ private String classifyName;
+
+ /**
+ *课程二级分类
+ **/
+ private String subClassify;
+
+ /**
+ * 课程二级分类名称
+ */
+ private String subClassifyName;
+
+ /**
+ *课程方向
+ **/
+ private String direction;
+
+ /**
+ *归属人
+ **/
+ private String username;
+
+ /**
+ *课程级别:1-初级,2-中级,3-高级
+ **/
+ private Integer level;
+
+ /**
+ *是否免费:0-否,1-是
+ **/
+ private Integer free;
+
+ /**
+ *课程价格
+ **/
+ private BigDecimal price;
+
+ /**
+ *时长
+ **/
+ private String time;
+
+ /**
+ *未上架(0)、上架(1)
+ **/
+ private Integer onsale;
+
+ /**
+ *课程描述
+ **/
+ private String brief;
+
+ /**
+ * 课程图片
+ */
+ private String picture;
+
+ /**
+ *未推荐(0)、推荐(1)
+ **/
+ private Integer recommend;
+
+ /**
+ *权重
+ **/
+ private Integer weight;
+
+ /**
+ *学习人数
+ **/
+ private Integer studyCount;
+
+ public String getName(){
+ return name;
+ }
+ public void setName(String name){
+ this.name = name;
+ }
+
+ public String getType(){
+ return type;
+ }
+ public void setType(String type){
+ this.type = type;
+ }
+
+ public String getClassify(){
+ return classify;
+ }
+ public void setClassify(String classify){
+ this.classify = classify;
+ }
+
+ public String getClassifyName() {
+ return classifyName;
+ }
+ public void setClassifyName(String classifyName) {
+ this.classifyName = classifyName;
+ }
+ public String getSubClassify(){
+ return subClassify;
+ }
+ public void setSubClassify(String subClassify){
+ this.subClassify = subClassify;
+ }
+
+ public String getSubClassifyName() {
+ return subClassifyName;
+ }
+ public void setSubClassifyName(String subClassifyName) {
+ this.subClassifyName = subClassifyName;
+ }
+ public String getDirection(){
+ return direction;
+ }
+ public void setDirection(String direction){
+ this.direction = direction;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+ public void setUsername(String username) {
+ this.username = username;
+ }
+ public Integer getLevel(){
+ return level;
+ }
+ public void setLevel(Integer level){
+ this.level = level;
+ }
+
+ public Integer getFree(){
+ return free;
+ }
+ public void setFree(Integer free){
+ this.free = free;
+ }
+
+ public BigDecimal getPrice(){
+ return price;
+ }
+ public void setPrice(BigDecimal price){
+ this.price = price;
+ }
+
+ public String getTime(){
+ return time;
+ }
+ public void setTime(String time){
+ this.time = time;
+ }
+
+ public Integer getOnsale(){
+ return onsale;
+ }
+ public void setOnsale(Integer onsale){
+ this.onsale = onsale;
+ }
+
+ public String getBrief(){
+ return brief;
+ }
+ public void setBrief(String brief){
+ this.brief = brief;
+ }
+
+ public Integer getRecommend(){
+ return recommend;
+ }
+ public void setRecommend(Integer recommend){
+ this.recommend = recommend;
+ }
+
+ public Integer getWeight(){
+ return weight;
+ }
+ public void setWeight(Integer weight){
+ this.weight = weight;
+ }
+
+ public Integer getStudyCount(){
+ return studyCount;
+ }
+ public void setStudyCount(Integer studyCount){
+ this.studyCount = studyCount;
+ }
+ public String getPicture() {
+ return picture;
+ }
+ public void setPicture(String picture) {
+ this.picture = picture;
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/domain/CourseComment.java b/src/main/java/com/krt/dairy/core/course/domain/CourseComment.java
new file mode 100644
index 0000000..985c487
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/domain/CourseComment.java
@@ -0,0 +1,144 @@
+package com.krt.dairy.core.course.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+/**
+ * 课程评论&QA
+ */
+public class CourseComment extends BaseEntity{
+
+ private static final long serialVersionUID = 789165716801545108L;
+
+ /**
+ *用户username
+ **/
+ private String username;
+
+ /**
+ *评论对象username
+ **/
+ private String toUsername;
+
+ /**
+ *课程id
+ **/
+ private Long courseId;
+
+ /**
+ *章节id
+ **/
+ private Long sectionId;
+
+ /**
+ *章节标题
+ **/
+ private String sectionTitle;
+
+ /**
+ *评论内容
+ **/
+ private String content;
+
+ /**
+ *引用id
+ **/
+ private Long refId;
+
+ /**
+ *引用内容
+ **/
+ private String refContent;
+
+ /**
+ *类型:0-评论;1-答疑QA
+ **/
+ private Integer type;
+
+
+ /**
+ * 用户头像
+ */
+ private String header;
+
+ /**
+ * 课程名称
+ */
+ private String courseName;
+
+ public String getUsername(){
+ return username;
+ }
+ public void setUsername(String username){
+ this.username = username;
+ }
+
+ public String getToUsername(){
+ return toUsername;
+ }
+ public void setToUsername(String toUsername){
+ this.toUsername = toUsername;
+ }
+
+ public Long getCourseId(){
+ return courseId;
+ }
+ public void setCourseId(Long courseId){
+ this.courseId = courseId;
+ }
+
+ public Long getSectionId(){
+ return sectionId;
+ }
+ public void setSectionId(Long sectionId){
+ this.sectionId = sectionId;
+ }
+
+ public String getSectionTitle(){
+ return sectionTitle;
+ }
+ public void setSectionTitle(String sectionTitle){
+ this.sectionTitle = sectionTitle;
+ }
+
+ public String getContent(){
+ return content;
+ }
+ public void setContent(String content){
+ this.content = content;
+ }
+
+ public Long getRefId(){
+ return refId;
+ }
+ public void setRefId(Long refId){
+ this.refId = refId;
+ }
+
+ public String getRefContent(){
+ return refContent;
+ }
+ public void setRefContent(String refContent){
+ this.refContent = refContent;
+ }
+
+ public Integer getType(){
+ return type;
+ }
+ public void setType(Integer type){
+ this.type = type;
+ }
+ public String getHeader() {
+ return header;
+ }
+ public void setHeader(String header) {
+ this.header = header;
+ }
+ public String getCourseName() {
+ return courseName;
+ }
+ public void setCourseName(String courseName) {
+ this.courseName = courseName;
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/domain/CourseQueryDto.java b/src/main/java/com/krt/dairy/core/course/domain/CourseQueryDto.java
new file mode 100644
index 0000000..a135f16
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/domain/CourseQueryDto.java
@@ -0,0 +1,76 @@
+package com.krt.dairy.core.course.domain;
+
+import com.krt.dairy.common.util.BeanUtil;
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * 课程查询实体类
+ */
+public class CourseQueryDto extends Course{
+
+ private static final long serialVersionUID = 6928526481007198051L;
+
+ private String sortField;
+
+ private String sortDirection = "DESC";
+
+ private Integer start=0;//limit开始
+
+ private Integer count;//数量
+
+ private Integer end;//limit结束
+
+
+ public String getSortField() {
+ return sortField;
+ }
+
+ /**
+ * 按照sortField升序
+ * @param sortField:指java bean中的属性
+ */
+ public void ascSortField(String sortField) {
+ if(StringUtils.isNotEmpty(sortField)){
+ this.sortField = BeanUtil.fieldToColumn(sortField);
+ this.sortDirection = " ASC ";
+ }
+ }
+
+ /**
+ * 按照sortField降序
+ * @param sortField :指java bean中的属性
+ */
+ public void descSortField(String sortField) {
+ if(StringUtils.isNotEmpty(sortField)){
+ this.sortField = BeanUtil.fieldToColumn(sortField);
+ this.sortDirection = " DESC ";
+ }
+ }
+
+ public String getSortDirection() {
+ return sortDirection;
+ }
+
+ public Integer getStart() {
+ return start;
+ }
+
+ public void setStart(Integer start) {
+ this.start = start;
+ }
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
+
+ public Integer getEnd() {
+ if(null != this.count){
+ if(null == this.start){
+ this.start = 0;
+ }
+ this.end = this.start + this.count;
+ }
+ return end;
+ }
+
+}
diff --git a/src/main/java/com/krt/dairy/core/course/domain/CourseSection.java b/src/main/java/com/krt/dairy/core/course/domain/CourseSection.java
new file mode 100644
index 0000000..4590aa8
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/domain/CourseSection.java
@@ -0,0 +1,96 @@
+package com.krt.dairy.core.course.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+/**
+ * 课程章节
+ */
+public class CourseSection extends BaseEntity{
+
+ private static final long serialVersionUID = -7261405404725335316L;
+
+ /**
+ *归属课程id
+ **/
+ private Long courseId;
+
+ /**
+ *父章节id,(只有2级)
+ **/
+ private Long parentId;
+
+ /**
+ *章节名称
+ **/
+ private String name;
+
+ /**
+ *排序
+ **/
+ private Integer sort;
+
+ /**
+ *时长
+ **/
+ private String time;
+
+ /**
+ *未上架(0)、上架(1)
+ **/
+ private Integer onsale;
+
+ /**
+ * 视频url
+ */
+ private String videoUrl;
+
+ public Long getCourseId(){
+ return courseId;
+ }
+ public void setCourseId(Long courseId){
+ this.courseId = courseId;
+ }
+
+ public Long getParentId(){
+ return parentId;
+ }
+ public void setParentId(Long parentId){
+ this.parentId = parentId;
+ }
+
+ public String getName(){
+ return name;
+ }
+ public void setName(String name){
+ this.name = name;
+ }
+
+ public Integer getSort(){
+ return sort;
+ }
+ public void setSort(Integer sort){
+ this.sort = sort;
+ }
+
+ public String getTime(){
+ return time;
+ }
+ public void setTime(String time){
+ this.time = time;
+ }
+
+ public Integer getOnsale(){
+ return onsale;
+ }
+ public void setOnsale(Integer onsale){
+ this.onsale = onsale;
+ }
+ public String getVideoUrl() {
+ return videoUrl;
+ }
+ public void setVideoUrl(String videoUrl) {
+ this.videoUrl = videoUrl;
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/service/ICourseCommentService.java b/src/main/java/com/krt/dairy/core/course/service/ICourseCommentService.java
new file mode 100644
index 0000000..158a866
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/service/ICourseCommentService.java
@@ -0,0 +1,64 @@
+package com.krt.dairy.core.course.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.course.domain.CourseComment;
+
+import java.util.List;
+
+
+public interface ICourseCommentService {
+
+ /**
+ *根据id获取
+ **/
+ public CourseComment getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(CourseComment queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(CourseComment queryEntity, TailPage page);
+
+ /**
+ * 分页获取我的所有课程的qa
+ */
+ public TailPage queryMyQAItemsPage(CourseComment queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void create(CourseComment entity);
+
+ /**
+ * 创建
+ */
+ public void createSelectivity(CourseComment entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(CourseComment entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(CourseComment entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(CourseComment entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(CourseComment entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/service/ICourseSectionService.java b/src/main/java/com/krt/dairy/core/course/service/ICourseSectionService.java
new file mode 100644
index 0000000..a99b762
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/service/ICourseSectionService.java
@@ -0,0 +1,75 @@
+package com.krt.dairy.core.course.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.course.domain.CourseSection;
+
+import java.util.List;
+
+
+public interface ICourseSectionService {
+
+ /**
+ *根据id获取
+ **/
+ public CourseSection getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(CourseSection queryEntity);
+
+ /**
+ * 获取课程章最大的sort
+ */
+ public Integer getMaxSort(Long courseId);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(CourseSection queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void createSelectivity(CourseSection entity);
+
+ /**
+ *批量创建
+ **/
+ public void createList(List entityList);
+
+ /**
+ *根据id更新
+ **/
+ public void update(CourseSection entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(CourseSection entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(CourseSection entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(CourseSection entity);
+
+ /**
+ * 比当前sort大的,正序排序的第一个
+ * @param curCourseSection
+ * @return
+ */
+ public CourseSection getSortSectionMax(CourseSection curCourseSection);
+
+ /**
+ * 比当前sort小的,倒序排序的第一个
+ * @param curCourseSection
+ * @return
+ */
+ public CourseSection getSortSectionMin(CourseSection curCourseSection);
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/service/ICourseService.java b/src/main/java/com/krt/dairy/core/course/service/ICourseService.java
new file mode 100644
index 0000000..3bd32d1
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/service/ICourseService.java
@@ -0,0 +1,50 @@
+package com.krt.dairy.core.course.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.course.domain.Course;
+import com.krt.dairy.core.course.domain.CourseQueryDto;
+
+import java.util.List;
+
+/**
+ * 课程服务层
+ */
+public interface ICourseService {
+
+ /**
+ *根据id获取
+ **/
+ public Course getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryList(CourseQueryDto queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(Course queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void createSelectivity(Course entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(Course entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(Course entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(Course entity);
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/service/impl/CourseCommentServiceImpl.java b/src/main/java/com/krt/dairy/core/course/service/impl/CourseCommentServiceImpl.java
new file mode 100644
index 0000000..ef46133
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/service/impl/CourseCommentServiceImpl.java
@@ -0,0 +1,82 @@
+package com.krt.dairy.core.course.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.course.dao.CourseCommentDao;
+import com.krt.dairy.core.course.domain.CourseComment;
+import com.krt.dairy.core.course.service.ICourseCommentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class CourseCommentServiceImpl implements ICourseCommentService{
+
+ @Autowired
+ private CourseCommentDao entityDao;
+
+ @Override
+ public CourseComment getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ @Override
+ public List queryAll(CourseComment queryEntity){
+ return entityDao.queryAll(queryEntity);
+ }
+
+ @Override
+ public TailPage queryPage(CourseComment queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ @Override
+ public TailPage queryMyQAItemsPage(CourseComment queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getMyQAItemsCount(queryEntity);
+ List items = entityDao.queryMyQAItemsPage(queryEntity,page);
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ @Override
+ public void create(CourseComment entity){
+ entityDao.create(entity);
+ }
+
+ /**
+ * 创建
+ */
+ public void createSelectivity(CourseComment entity){
+ entityDao.createSelectivity(entity);
+ }
+
+ @Override
+ public void update(CourseComment entity){
+ entityDao.update(entity);
+ }
+
+ @Override
+ public void updateSelectivity(CourseComment entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ @Override
+ public void delete(CourseComment entity){
+ entityDao.delete(entity);
+ }
+
+ @Override
+ public void deleteLogic(CourseComment entity){
+ entityDao.deleteLogic(entity);
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/service/impl/CourseSectionServiceImpl.java b/src/main/java/com/krt/dairy/core/course/service/impl/CourseSectionServiceImpl.java
new file mode 100644
index 0000000..2b990f8
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/service/impl/CourseSectionServiceImpl.java
@@ -0,0 +1,88 @@
+package com.krt.dairy.core.course.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.course.dao.CourseSectionDao;
+import com.krt.dairy.core.course.domain.CourseSection;
+import com.krt.dairy.core.course.service.ICourseSectionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class CourseSectionServiceImpl implements ICourseSectionService{
+
+ @Autowired
+ private CourseSectionDao entityDao;
+
+ public CourseSection getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ public List queryAll(CourseSection queryEntity){
+ return entityDao.queryAll(queryEntity);
+ }
+
+ /**
+ * 获取课程章最大的sort
+ */
+ public Integer getMaxSort(Long courseId){
+ return entityDao.getMaxSort(courseId);
+ }
+
+ public TailPage queryPage(CourseSection queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ public void createSelectivity(CourseSection entity){
+ entityDao.createSelectivity(entity);
+ }
+
+ /**
+ *批量创建
+ **/
+ public void createList(List entityList){
+ entityDao.createList(entityList);
+ }
+
+ public void update(CourseSection entity){
+ entityDao.update(entity);
+ }
+
+ public void updateSelectivity(CourseSection entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ public void delete(CourseSection entity){
+ entityDao.delete(entity);
+ }
+
+ public void deleteLogic(CourseSection entity){
+ entityDao.deleteLogic(entity);
+ }
+
+ /**
+ * 比当前sort大的,正序排序的第一个
+ * @param curCourseSection
+ * @return
+ */
+ public CourseSection getSortSectionMax(CourseSection curCourseSection){
+ return entityDao.getSortSectionMax(curCourseSection);
+ }
+
+ /**
+ * 比当前sort小的,倒序排序的第一个
+ * @param curCourseSection
+ * @return
+ */
+ public CourseSection getSortSectionMin(CourseSection curCourseSection){
+ return entityDao.getSortSectionMin(curCourseSection);
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/course/service/impl/CourseServiceImpl.java b/src/main/java/com/krt/dairy/core/course/service/impl/CourseServiceImpl.java
new file mode 100644
index 0000000..c4eb642
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/course/service/impl/CourseServiceImpl.java
@@ -0,0 +1,82 @@
+package com.krt.dairy.core.course.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.common.storage.QiniuStorage;
+import com.krt.dairy.core.consts.CourseEnum;
+import com.krt.dairy.core.course.dao.CourseDao;
+import com.krt.dairy.core.course.domain.Course;
+import com.krt.dairy.core.course.domain.CourseQueryDto;
+import com.krt.dairy.core.course.service.ICourseService;
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class CourseServiceImpl implements ICourseService{
+
+ @Autowired
+ private CourseDao entityDao;
+
+ private void prepareCoursePicture(Course course){
+ if(null != course && StringUtils.isNotEmpty(course.getPicture())){
+ course.setPicture(QiniuStorage.getUrl(course.getPicture()));
+ }
+ }
+
+ @Override
+ public Course getById(Long id){
+ Course course = entityDao.getById(id);
+ prepareCoursePicture(course);
+ return course;
+ }
+
+ @Override
+ public List queryList(CourseQueryDto queryEntity){
+ if(null == queryEntity.getOnsale()){//是否上架
+ queryEntity.setOnsale(CourseEnum.ONSALE.value());
+ }
+ return entityDao.queryList(queryEntity);
+ }
+
+ @Override
+ public TailPage queryPage(Course queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ if(CollectionUtils.isNotEmpty(items)){
+ for(Course item : items){
+ prepareCoursePicture(item);
+ }
+ }
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ @Override
+ public void createSelectivity(Course entity){
+ entityDao.createSelectivity(entity);
+ }
+
+ @Override
+ public void updateSelectivity(Course entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ //物理删除
+ @Override
+ public void delete(Course entity){
+ entityDao.delete(entity);
+ }
+
+ //逻辑删除
+ @Override
+ public void deleteLogic(Course entity){
+ entityDao.deleteLogic(entity);
+ }
+
+}
+
+
diff --git a/src/main/java/com/krt/dairy/core/user/dao/UserCollectionsDao.java b/src/main/java/com/krt/dairy/core/user/dao/UserCollectionsDao.java
new file mode 100644
index 0000000..f37d76e
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/dao/UserCollectionsDao.java
@@ -0,0 +1,64 @@
+package com.krt.dairy.core.user.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.domain.UserCollections;
+
+import java.util.List;
+
+
+public interface UserCollectionsDao {
+
+ /**
+ *根据id获取
+ **/
+ public UserCollections getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(UserCollections queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(UserCollections queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(UserCollections queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void create(UserCollections entity);
+
+ /**
+ *创建新记录
+ **/
+ public void createSelectivity(UserCollections entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(UserCollections entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(UserCollections entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(UserCollections entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(UserCollections entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/dao/UserCollectionsMapper.xml b/src/main/java/com/krt/dairy/core/user/dao/UserCollectionsMapper.xml
new file mode 100644
index 0000000..5cf9bef
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/dao/UserCollectionsMapper.xml
@@ -0,0 +1,190 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ user_id, classify,object_id, tips, create_time, create_user, update_time,
+ update_user, del, id
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_user_collections
+ ( user_id, classify, object_id, tips, create_time, create_user, update_time,
+ update_user, del, id )
+ VALUES
+ ( #{userId, jdbcType=INTEGER}, #{classify, jdbcType=INTEGER},#{objectId, jdbcType=INTEGER},#{tips, jdbcType=VARCHAR}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP},
+ #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ INSERT INTO t_user_collections
+
+
+ user_id,
+
+
+ classify,
+
+
+ object_id,
+
+
+ tips,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{userId, jdbcType=INTEGER},
+
+
+ #{classify, jdbcType=INTEGER},
+
+
+ #{objectId, jdbcType=INTEGER},
+
+
+ #{tips, jdbcType=VARCHAR},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_user_collections SET
+ user_id = #{userId, jdbcType=INTEGER},
+ classify = #{classify, jdbcType=INTEGER},
+ object_id = #{objectId, jdbcType=INTEGER},
+ tips = #{tips, jdbcType=VARCHAR},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_user_collections
+
+
+ user_id = #{userId, jdbcType=INTEGER},
+
+
+ classify = #{classify, jdbcType=INTEGER},
+
+
+ object_id = #{objectId, jdbcType=INTEGER},
+
+
+ tips = #{tips, jdbcType=VARCHAR},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE FROM t_user_collections
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_user_collections
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/user/dao/UserCourseSectionDao.java b/src/main/java/com/krt/dairy/core/user/dao/UserCourseSectionDao.java
new file mode 100644
index 0000000..99eaaf8
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/dao/UserCourseSectionDao.java
@@ -0,0 +1,65 @@
+package com.krt.dairy.core.user.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.domain.UserCourseSection;
+import com.krt.dairy.core.user.domain.UserCourseSectionDto;
+
+import java.util.List;
+
+
+public interface UserCourseSectionDao {
+
+ /**
+ *根据id获取
+ **/
+ public UserCourseSection getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(UserCourseSection queryEntity);
+
+ /**
+ * 获取最新的学习记录
+ */
+ public UserCourseSection queryLatest(UserCourseSection queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(UserCourseSection queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(UserCourseSection queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void createSelectivity(UserCourseSection entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(UserCourseSection entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(UserCourseSection entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(UserCourseSection entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(UserCourseSection entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/dao/UserCourseSectionMapper.xml b/src/main/java/com/krt/dairy/core/user/dao/UserCourseSectionMapper.xml
new file mode 100644
index 0000000..965fd73
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/dao/UserCourseSectionMapper.xml
@@ -0,0 +1,220 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ user_id, course_id, section_id, status, rate, create_time, create_user,
+ update_time, update_user, del, id
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_user_course_section
+ ( user_id, course_id, section_id, status, rate, create_time, create_user,
+ update_time, update_user, del, id )
+ VALUES
+ ( #{userId, jdbcType=INTEGER}, #{courseId, jdbcType=INTEGER}, #{sectionId, jdbcType=INTEGER}, #{status, jdbcType=INTEGER}, #{rate, jdbcType=INTEGER}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR},
+ #{updateTime, jdbcType=TIMESTAMP}, #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ INSERT INTO t_user_course_section
+
+
+ user_id,
+
+
+ course_id,
+
+
+ section_id,
+
+
+ status,
+
+
+ rate,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{userId, jdbcType=INTEGER},
+
+
+ #{courseId, jdbcType=INTEGER},
+
+
+ #{sectionId, jdbcType=INTEGER},
+
+
+ #{status, jdbcType=INTEGER},
+
+
+ #{rate, jdbcType=INTEGER},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_user_course_section SET
+ user_id = #{userId, jdbcType=INTEGER},
+ course_id = #{courseId, jdbcType=INTEGER},
+ section_id = #{sectionId, jdbcType=INTEGER},
+ status = #{status, jdbcType=INTEGER},
+ rate = #{rate, jdbcType=INTEGER},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_user_course_section
+
+
+ user_id = #{userId, jdbcType=INTEGER},
+
+
+ course_id = #{courseId, jdbcType=INTEGER},
+
+
+ section_id = #{sectionId, jdbcType=INTEGER},
+
+
+ status = #{status, jdbcType=INTEGER},
+
+
+ rate = #{rate, jdbcType=INTEGER},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE
+ FROM t_user_course_section
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_user_course_section
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/user/dao/UserFollowsDao.java b/src/main/java/com/krt/dairy/core/user/dao/UserFollowsDao.java
new file mode 100644
index 0000000..d6d5116
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/dao/UserFollowsDao.java
@@ -0,0 +1,70 @@
+package com.krt.dairy.core.user.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.domain.UserFollowStudyRecord;
+import com.krt.dairy.core.user.domain.UserFollows;
+
+import java.util.List;
+
+
+public interface UserFollowsDao {
+
+ /**
+ *根据id获取
+ **/
+ public UserFollows getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(UserFollows queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(UserFollows queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(UserFollows queryEntity, TailPage page);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getFollowStudyRecordCount(UserFollowStudyRecord queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryFollowStudyRecord(UserFollowStudyRecord queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void createSelectivity(UserFollows entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(UserFollows entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(UserFollows entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(UserFollows entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(UserFollows entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/dao/UserFollowsMapper.xml b/src/main/java/com/krt/dairy/core/user/dao/UserFollowsMapper.xml
new file mode 100644
index 0000000..55a9c61
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/dao/UserFollowsMapper.xml
@@ -0,0 +1,187 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ user_id, follow_id, create_time, create_user, update_time, update_user,
+ del, id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_user_follows
+ ( user_id, follow_id, create_time, create_user, update_time, update_user,
+ del, id )
+ VALUES
+ ( #{userId, jdbcType=VARCHAR}, #{followId, jdbcType=VARCHAR}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP}, #{updateUser, jdbcType=VARCHAR},
+ #{del, jdbcType=TINYINT}, #{id, jdbcType=VARCHAR} )
+
+
+
+ INSERT INTO t_user_follows
+
+
+ user_id,
+
+
+ follow_id,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{userId, jdbcType=INTEGER},
+
+
+ #{followId, jdbcType=INTEGER},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_user_follows SET
+ user_id = #{userId, jdbcType=VARCHAR},
+ follow_id = #{followId, jdbcType=VARCHAR},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_user_follows
+
+
+ user_id = #{userId, jdbcType=VARCHAR},
+
+
+ follow_id = #{followId, jdbcType=VARCHAR},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE FROM t_user_follows
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_user_follows
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/user/dao/UserMessageDao.java b/src/main/java/com/krt/dairy/core/user/dao/UserMessageDao.java
new file mode 100644
index 0000000..c8edeb5
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/dao/UserMessageDao.java
@@ -0,0 +1,59 @@
+package com.krt.dairy.core.user.dao;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.domain.UserMessage;
+
+import java.util.List;
+
+
+public interface UserMessageDao {
+
+ /**
+ *根据id获取
+ **/
+ public UserMessage getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(UserMessage queryEntity);
+
+ /**
+ *获取总数量
+ **/
+ public Integer getTotalItemsCount(UserMessage queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public List queryPage(UserMessage queryEntity, TailPage page);
+
+ /**
+ *创建新记录
+ **/
+ public void create(UserMessage entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(UserMessage entity);
+
+ /**
+ *根据id选择性更新自动
+ **/
+ public void updateSelectivity(UserMessage entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(UserMessage entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(UserMessage entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/dao/UserMessageMapper.xml b/src/main/java/com/krt/dairy/core/user/dao/UserMessageMapper.xml
new file mode 100644
index 0000000..43ebbf9
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/dao/UserMessageMapper.xml
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ user_id, send_user_id, send_user_name, ref_id, ref_content, type,
+ status, create_time, create_user, update_time, update_user, del,
+ id
+
+
+
+
+
+
+
+
+
+
+
+ INSERT INTO t_user_message
+ ( user_id, send_user_id, send_user_name, ref_id, ref_content, type,
+ status, create_time, create_user, update_time, update_user, del,
+ id )
+ VALUES
+ ( #{userId, jdbcType=VARCHAR}, #{sendUserId, jdbcType=VARCHAR}, #{sendUserName, jdbcType=VARCHAR}, #{refId, jdbcType=VARCHAR}, #{refContent, jdbcType=VARCHAR}, #{type, jdbcType=INTEGER},
+ #{status, jdbcType=INTEGER}, #{createTime, jdbcType=DATE}, #{createUser, jdbcType=VARCHAR}, #{updateTime, jdbcType=TIMESTAMP}, #{updateUser, jdbcType=VARCHAR}, #{del, jdbcType=TINYINT},
+ #{id, jdbcType=VARCHAR} )
+
+
+
+ INSERT INTO t_user_message
+
+
+ user_id,
+
+
+ send_user_id,
+
+
+ send_user_name,
+
+
+ ref_id,
+
+
+ ref_content,
+
+
+ type,
+
+
+ status,
+
+
+ create_time,
+
+
+ create_user,
+
+
+ update_time,
+
+
+ update_user,
+
+
+ del,
+
+
+ VALUES
+
+
+ #{userId, jdbcType=INTEGER},
+
+
+ #{sendUserId, jdbcType=INTEGER},
+
+
+ #{sendUserName, jdbcType=VARCHAR},
+
+
+ #{refId, jdbcType=VARCHAR},
+
+
+ #{refContent, jdbcType=VARCHAR},
+
+
+ #{type, jdbcType=INTEGER},
+
+
+ #{status, jdbcType=INTEGER},
+
+
+ #{createTime, jdbcType=DATE},
+
+
+ #{createUser, jdbcType=VARCHAR},
+
+
+ #{updateTime, jdbcType=TIMESTAMP},
+
+
+ #{updateUser, jdbcType=VARCHAR},
+
+
+ #{del, jdbcType=TINYINT},
+
+
+
+
+
+ UPDATE t_user_message SET
+ user_id = #{userId, jdbcType=VARCHAR},
+ send_user_id = #{sendUserId, jdbcType=VARCHAR},
+ send_user_name = #{sendUserName, jdbcType=VARCHAR},
+ ref_id = #{refId, jdbcType=VARCHAR},
+ ref_content = #{refContent, jdbcType=VARCHAR},
+ type = #{type, jdbcType=INTEGER},
+ status = #{status, jdbcType=INTEGER},
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+ update_user = #{updateUser, jdbcType=VARCHAR}
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_user_message
+
+
+ user_id = #{userId, jdbcType=VARCHAR},
+
+
+ send_user_id = #{sendUserId, jdbcType=VARCHAR},
+
+
+ send_user_name = #{sendUserName, jdbcType=VARCHAR},
+
+
+ ref_id = #{refId, jdbcType=VARCHAR},
+
+
+ ref_content = #{refContent, jdbcType=VARCHAR},
+
+
+ type = #{type, jdbcType=INTEGER},
+
+
+ status = #{status, jdbcType=INTEGER},
+
+
+ update_time = #{updateTime, jdbcType=TIMESTAMP},
+
+
+ update_user = #{updateUser, jdbcType=VARCHAR},
+
+
+ del = #{del, jdbcType=TINYINT},
+
+
+ WHERE id = #{id, jdbcType = INTEGER}
+
+
+
+
+ DELETE FROM t_user_message
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
+ UPDATE t_user_message
+ SET del = 1
+ WHERE id = #{id, jdbcType=INTEGER}
+
+
+
diff --git a/src/main/java/com/krt/dairy/core/user/domain/UserCollections.java b/src/main/java/com/krt/dairy/core/user/domain/UserCollections.java
new file mode 100644
index 0000000..4601d6d
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/domain/UserCollections.java
@@ -0,0 +1,69 @@
+package com.krt.dairy.core.user.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+
+public class UserCollections extends BaseEntity{
+
+ private static final long serialVersionUID = -3909997252117758595L;
+
+ /**
+ *用户id
+ **/
+ private Long userId;
+
+ /**
+ *用户收藏分类
+ **/
+ private Integer classify;
+
+ /**
+ * 用户收藏id
+ */
+ private Long objectId;
+
+ /**
+ *用户收藏备注
+ **/
+ private String tips;
+
+ /**
+ * 收藏名称
+ */
+ private String name;
+
+ public Long getUserId(){
+ return userId;
+ }
+ public void setUserId(Long userId){
+ this.userId = userId;
+ }
+
+ public Integer getClassify(){
+ return classify;
+ }
+ public void setClassify(Integer classify){
+ this.classify = classify;
+ }
+
+ public String getTips(){
+ return tips;
+ }
+ public void setTips(String tips){
+ this.tips = tips;
+ }
+ public Long getObjectId() {
+ return objectId;
+ }
+ public void setObjectId(Long objectId) {
+ this.objectId = objectId;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/domain/UserCourseSection.java b/src/main/java/com/krt/dairy/core/user/domain/UserCourseSection.java
new file mode 100644
index 0000000..d71de26
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/domain/UserCourseSection.java
@@ -0,0 +1,70 @@
+package com.krt.dairy.core.user.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+
+public class UserCourseSection extends BaseEntity{
+
+ private static final long serialVersionUID = 5447461555053008202L;
+
+ /**
+ *用户id
+ **/
+ private Long userId;
+
+ /**
+ *课程id
+ **/
+ private Long courseId;
+
+ /**
+ *章节id
+ **/
+ private Long sectionId;
+
+ /**
+ *状态:0-学习中;1-学习结束
+ **/
+ private Integer status;
+
+ /**
+ * 进度
+ */
+ private Integer rate;
+
+ public Long getUserId(){
+ return userId;
+ }
+ public void setUserId(Long userId){
+ this.userId = userId;
+ }
+
+ public Long getCourseId(){
+ return courseId;
+ }
+ public void setCourseId(Long courseId){
+ this.courseId = courseId;
+ }
+
+ public Long getSectionId(){
+ return sectionId;
+ }
+ public void setSectionId(Long sectionId){
+ this.sectionId = sectionId;
+ }
+
+ public Integer getStatus(){
+ return status;
+ }
+ public void setStatus(Integer status){
+ this.status = status;
+ }
+ public Integer getRate() {
+ return rate;
+ }
+ public void setRate(Integer rate) {
+ this.rate = rate;
+ }
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/domain/UserCourseSectionDto.java b/src/main/java/com/krt/dairy/core/user/domain/UserCourseSectionDto.java
new file mode 100644
index 0000000..c4c4384
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/domain/UserCourseSectionDto.java
@@ -0,0 +1,62 @@
+package com.krt.dairy.core.user.domain;
+
+/**
+ * 用户学习课程dto
+ */
+public class UserCourseSectionDto extends UserCourseSection {
+
+ private static final long serialVersionUID = 608405844566660424L;
+
+ /**
+ * 用户名
+ */
+ private String username;
+
+ /**
+ * 课程名
+ */
+ private String courseName;
+
+ /**
+ * 章节名
+ */
+ private String sectionName;
+
+ /**
+ * 用户头像
+ */
+ private String header;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getCourseName() {
+ return courseName;
+ }
+
+ public void setCourseName(String courseName) {
+ this.courseName = courseName;
+ }
+
+ public String getSectionName() {
+ return sectionName;
+ }
+
+ public void setSectionName(String sectionName) {
+ this.sectionName = sectionName;
+ }
+
+ public String getHeader() {
+ return header;
+ }
+
+ public void setHeader(String header) {
+ this.header = header;
+ }
+
+}
diff --git a/src/main/java/com/krt/dairy/core/user/domain/UserFollowStudyRecord.java b/src/main/java/com/krt/dairy/core/user/domain/UserFollowStudyRecord.java
new file mode 100644
index 0000000..44d5f70
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/domain/UserFollowStudyRecord.java
@@ -0,0 +1,127 @@
+package com.krt.dairy.core.user.domain;
+
+import java.util.Date;
+
+/**
+ * 关注的用户学习记录dto
+ */
+public class UserFollowStudyRecord {
+
+ /**
+ * 课程id
+ */
+ private Long courseId;
+
+ /**
+ * 章节id
+ */
+ private Long sectionId;
+
+ /**
+ * 用户id
+ */
+ private Long userId;
+
+ /**
+ * 用户登录名
+ */
+ private String username;
+
+ /**
+ * 用户头像
+ */
+ private String header;
+
+ /**
+ * 关注用户id
+ */
+ private Long followId;
+
+ /**
+ * 课程名称
+ */
+ private String courseName;
+
+ /**
+ * 章节名称
+ */
+ private String sectionName;
+
+ /**
+ * 创建时间
+ */
+ private Date createTime;
+
+ public Long getCourseId() {
+ return courseId;
+ }
+
+ public void setCourseId(Long courseId) {
+ this.courseId = courseId;
+ }
+
+ public Long getSectionId() {
+ return sectionId;
+ }
+
+ public void setSectionId(Long sectionId) {
+ this.sectionId = sectionId;
+ }
+
+ public Long getUserId() {
+ return userId;
+ }
+
+ public void setUserId(Long userId) {
+ this.userId = userId;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getHeader() {
+ return header;
+ }
+
+ public void setHeader(String header) {
+ this.header = header;
+ }
+
+ public Long getFollowId() {
+ return followId;
+ }
+
+ public void setFollowId(Long followId) {
+ this.followId = followId;
+ }
+
+ public String getCourseName() {
+ return courseName;
+ }
+
+ public void setCourseName(String courseName) {
+ this.courseName = courseName;
+ }
+
+ public String getSectionName() {
+ return sectionName;
+ }
+
+ public void setSectionName(String sectionName) {
+ this.sectionName = sectionName;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+
+}
diff --git a/src/main/java/com/krt/dairy/core/user/domain/UserFollows.java b/src/main/java/com/krt/dairy/core/user/domain/UserFollows.java
new file mode 100644
index 0000000..a1e0785
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/domain/UserFollows.java
@@ -0,0 +1,37 @@
+package com.krt.dairy.core.user.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+
+public class UserFollows extends BaseEntity{
+
+ private static final long serialVersionUID = -275116124638094439L;
+
+ /**
+ *用户id
+ **/
+ private Long userId;
+
+ /**
+ *关注的用户id
+ **/
+ private Long followId;
+
+ public Long getUserId(){
+ return userId;
+ }
+ public void setUserId(Long userId){
+ this.userId = userId;
+ }
+
+ public Long getFollowId(){
+ return followId;
+ }
+ public void setFollowId(Long followId){
+ this.followId = followId;
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/domain/UserMessage.java b/src/main/java/com/krt/dairy/core/user/domain/UserMessage.java
new file mode 100644
index 0000000..0394b09
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/domain/UserMessage.java
@@ -0,0 +1,97 @@
+package com.krt.dairy.core.user.domain;
+
+import com.krt.dairy.common.orm.BaseEntity;
+
+
+public class UserMessage extends BaseEntity{
+
+ private static final long serialVersionUID = -5308032957532522065L;
+
+ /**
+ *消息接收用户id
+ **/
+ private Long userId;
+
+ /**
+ *消息发起用户id
+ **/
+ private Long sendUserId;
+
+ /**
+ *消息发起用户名称
+ **/
+ private String sendUserName;
+
+ /**
+ *引用id
+ **/
+ private String refId;
+
+ /**
+ *引用内容
+ **/
+ private String refContent;
+
+ /**
+ *通知的类型,1-评论,2-关注,3-答疑
+ **/
+ private Integer type;
+
+ /**
+ *未读(0)、已读(1)
+ **/
+ private Integer status;
+
+ public Long getUserId(){
+ return userId;
+ }
+ public void setUserId(Long userId){
+ this.userId = userId;
+ }
+
+ public Long getSendUserId(){
+ return sendUserId;
+ }
+ public void setSendUserId(Long sendUserId){
+ this.sendUserId = sendUserId;
+ }
+
+ public String getSendUserName(){
+ return sendUserName;
+ }
+ public void setSendUserName(String sendUserName){
+ this.sendUserName = sendUserName;
+ }
+
+ public String getRefId(){
+ return refId;
+ }
+ public void setRefId(String refId){
+ this.refId = refId;
+ }
+
+ public String getRefContent(){
+ return refContent;
+ }
+ public void setRefContent(String refContent){
+ this.refContent = refContent;
+ }
+
+ public Integer getType(){
+ return type;
+ }
+ public void setType(Integer type){
+ this.type = type;
+ }
+
+ public Integer getStatus(){
+ return status;
+ }
+ public void setStatus(Integer status){
+ this.status = status;
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/service/IUserCollectionsService.java b/src/main/java/com/krt/dairy/core/user/service/IUserCollectionsService.java
new file mode 100644
index 0000000..c3548d7
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/service/IUserCollectionsService.java
@@ -0,0 +1,54 @@
+package com.krt.dairy.core.user.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.domain.UserCollections;
+
+import java.util.List;
+
+
+public interface IUserCollectionsService {
+
+ /**
+ *根据id获取
+ **/
+ public UserCollections getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(UserCollections queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(UserCollections queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void createSelectivity(UserCollections entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(UserCollections entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(UserCollections entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(UserCollections entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(UserCollections entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/service/IUserCourseSectionService.java b/src/main/java/com/krt/dairy/core/user/service/IUserCourseSectionService.java
new file mode 100644
index 0000000..99ea0e2
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/service/IUserCourseSectionService.java
@@ -0,0 +1,60 @@
+package com.krt.dairy.core.user.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.domain.UserCourseSection;
+import com.krt.dairy.core.user.domain.UserCourseSectionDto;
+
+import java.util.List;
+
+
+public interface IUserCourseSectionService {
+
+ /**
+ *根据id获取
+ **/
+ public UserCourseSection getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(UserCourseSection queryEntity);
+
+ /**
+ * 获取最新的
+ */
+ public UserCourseSection queryLatest(UserCourseSection queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(UserCourseSection queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void createSelectivity(UserCourseSection entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(UserCourseSection entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(UserCourseSection entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(UserCourseSection entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(UserCourseSection entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/service/IUserFollowsService.java b/src/main/java/com/krt/dairy/core/user/service/IUserFollowsService.java
new file mode 100644
index 0000000..4e76492
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/service/IUserFollowsService.java
@@ -0,0 +1,60 @@
+package com.krt.dairy.core.user.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.domain.UserFollowStudyRecord;
+import com.krt.dairy.core.user.domain.UserFollows;
+
+import java.util.List;
+
+
+public interface IUserFollowsService {
+
+ /**
+ *根据id获取
+ **/
+ public UserFollows getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(UserFollows queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(UserFollows queryEntity, TailPage page);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryUserFollowStudyRecordPage(UserFollowStudyRecord queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void createSelectivity(UserFollows entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(UserFollows entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(UserFollows entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(UserFollows entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(UserFollows entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/service/IUserMessageService.java b/src/main/java/com/krt/dairy/core/user/service/IUserMessageService.java
new file mode 100644
index 0000000..46ac258
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/service/IUserMessageService.java
@@ -0,0 +1,54 @@
+package com.krt.dairy.core.user.service;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.domain.UserMessage;
+
+import java.util.List;
+
+
+public interface IUserMessageService {
+
+ /**
+ *根据id获取
+ **/
+ public UserMessage getById(Long id);
+
+ /**
+ *获取所有
+ **/
+ public List queryAll(UserMessage queryEntity);
+
+ /**
+ *分页获取
+ **/
+ public TailPage queryPage(UserMessage queryEntity, TailPage page);
+
+ /**
+ *创建
+ **/
+ public void create(UserMessage entity);
+
+ /**
+ *根据id更新
+ **/
+ public void update(UserMessage entity);
+
+ /**
+ *根据id 进行可选性更新
+ **/
+ public void updateSelectivity(UserMessage entity);
+
+ /**
+ *物理删除
+ **/
+ public void delete(UserMessage entity);
+
+ /**
+ *逻辑删除
+ **/
+ public void deleteLogic(UserMessage entity);
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/service/impl/UserCollectionsServiceImpl.java b/src/main/java/com/krt/dairy/core/user/service/impl/UserCollectionsServiceImpl.java
new file mode 100644
index 0000000..5e16945
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/service/impl/UserCollectionsServiceImpl.java
@@ -0,0 +1,58 @@
+package com.krt.dairy.core.user.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.dao.UserCollectionsDao;
+import com.krt.dairy.core.user.domain.UserCollections;
+import com.krt.dairy.core.user.service.IUserCollectionsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class UserCollectionsServiceImpl implements IUserCollectionsService{
+
+ @Autowired
+ private UserCollectionsDao entityDao;
+
+ public UserCollections getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ public List queryAll(UserCollections queryEntity){
+ return entityDao.queryAll(queryEntity);
+ }
+
+ public TailPage queryPage(UserCollections queryEntity ,TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ public void createSelectivity(UserCollections entity){
+ entityDao.createSelectivity(entity);
+ }
+
+ public void update(UserCollections entity){
+ entityDao.update(entity);
+ }
+
+ public void updateSelectivity(UserCollections entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ public void delete(UserCollections entity){
+ entityDao.delete(entity);
+ }
+
+ public void deleteLogic(UserCollections entity){
+ entityDao.deleteLogic(entity);
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/service/impl/UserCourseSectionServiceImpl.java b/src/main/java/com/krt/dairy/core/user/service/impl/UserCourseSectionServiceImpl.java
new file mode 100644
index 0000000..501bd8b
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/service/impl/UserCourseSectionServiceImpl.java
@@ -0,0 +1,63 @@
+package com.krt.dairy.core.user.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.dao.UserCourseSectionDao;
+import com.krt.dairy.core.user.domain.UserCourseSection;
+import com.krt.dairy.core.user.domain.UserCourseSectionDto;
+import com.krt.dairy.core.user.service.IUserCourseSectionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class UserCourseSectionServiceImpl implements IUserCourseSectionService{
+
+ @Autowired
+ private UserCourseSectionDao entityDao;
+
+ public UserCourseSection getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ public List queryAll(UserCourseSection queryEntity){
+ return entityDao.queryAll(queryEntity);
+ }
+
+ public UserCourseSection queryLatest(UserCourseSection queryEntity){
+ return entityDao.queryLatest(queryEntity);
+ }
+
+ public TailPage queryPage(UserCourseSection queryEntity , TailPage page){
+ Integer itemsTotalCount = entityDao.getTotalItemsCount(queryEntity);
+ List items = entityDao.queryPage(queryEntity,page);
+ page.setItemsTotalCount(itemsTotalCount);
+ page.setItems(items);
+ return page;
+ }
+
+ public void createSelectivity(UserCourseSection entity){
+ entityDao.createSelectivity(entity);
+ }
+
+ public void update(UserCourseSection entity){
+ entityDao.update(entity);
+ }
+
+ public void updateSelectivity(UserCourseSection entity){
+ entityDao.updateSelectivity(entity);
+ }
+
+ public void delete(UserCourseSection entity){
+ entityDao.delete(entity);
+ }
+
+ public void deleteLogic(UserCourseSection entity){
+ entityDao.deleteLogic(entity);
+ }
+
+
+
+}
+
diff --git a/src/main/java/com/krt/dairy/core/user/service/impl/UserFollowsServiceImpl.java b/src/main/java/com/krt/dairy/core/user/service/impl/UserFollowsServiceImpl.java
new file mode 100644
index 0000000..60dd8de
--- /dev/null
+++ b/src/main/java/com/krt/dairy/core/user/service/impl/UserFollowsServiceImpl.java
@@ -0,0 +1,67 @@
+package com.krt.dairy.core.user.service.impl;
+
+import com.krt.dairy.common.page.TailPage;
+import com.krt.dairy.core.user.dao.UserFollowsDao;
+import com.krt.dairy.core.user.domain.UserFollowStudyRecord;
+import com.krt.dairy.core.user.domain.UserFollows;
+import com.krt.dairy.core.user.service.IUserFollowsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+
+@Service
+public class UserFollowsServiceImpl implements IUserFollowsService{
+
+ @Autowired
+ private UserFollowsDao entityDao;
+
+ public UserFollows getById(Long id){
+ return entityDao.getById(id);
+ }
+
+ public List queryAll(UserFollows queryEntity){
+ return entityDao.queryAll(queryEntity);
+ }
+
+ public TailPage