-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- First of all, thank you for your contribution! 😄 For requesting to pull a new feature or bugfix, please send it from a feature/bugfix branch based on the `master` branch. Before submitting your pull request, please make sure the checklist below is confirmed. Your pull requests will be merged after one of the collaborators approve. Thank you! --> ### 🤔 This is a ... - [x] New feature - [x] Bug fix - [ ] Site / documentation update - [ ] Demo update - [ ] Component style update - [ ] TypeScript definition update - [ ] Bundle size optimization - [ ] Performance optimization - [ ] Enhancement feature - [ ] Internationalization - [ ] Refactoring - [ ] Code style optimization - [ ] Test Case - [ ] Branch merge - [ ] Other (about what?) ### 🔗 Related issue link <!-- 1. Put the related issue or discussion links here. --> ### 💡 Background and solution <!-- 1. Describe the problem and the scenario. 2. GIF or snapshot should be provided if includes UI/interactive modification. 3. How to fix the problem, and list the final API implementation and usage sample if that is a new feature. --> ### 📝 Changelog <!-- Describe changes from the user side, and list all potential break changes or other risks. ---> | Language | Changelog | | ---------- | --------- | | 🇺🇸 English | | | 🇨🇳 Chinese | | ### ☑️ Self-Check before Merge⚠️ Please check all items below before review.⚠️ - [x] Doc is updated/provided or not needed - [ ] Demo is updated/provided or not needed - [ ] TypeScript's definition is updated/provided or not needed - [ ] Changelog is provided or not needed
- Loading branch information
Showing
13 changed files
with
158 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: easy-admin | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: easy-admin | ||
template: | ||
metadata: | ||
labels: | ||
app: easy-admin | ||
spec: | ||
containers: | ||
- name: easy-admin | ||
image: nicesteven/easy-admin:latest | ||
resources: | ||
limits: | ||
memory: "128Mi" | ||
cpu: "500m" | ||
ports: | ||
- containerPort: 8080 | ||
volumeMounts: | ||
- name: easy-admin | ||
mountPath: /temp | ||
- name: easy-admin | ||
mountPath: /static | ||
- name: easy-admin-config | ||
mountPath: /config/ | ||
readOnly: true | ||
volumes: | ||
- name: easy-admin | ||
persistentVolumeClaim: | ||
claimName: easy-admin | ||
- name: easy-admin-config | ||
configMap: | ||
name: settings-admin | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: easy-admin-svc | ||
spec: | ||
selector: | ||
app: easy-admin-port | ||
ports: | ||
- port: 8080 | ||
targetPort: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: easy-admin | ||
namespace: easy-admin | ||
spec: | ||
accessModes: | ||
- ReadWriteMany | ||
resources: | ||
requests: | ||
storage: "1Mi" | ||
volumeName: | ||
storageClassName: nfs-csi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"net/http" | ||
"net/http/httptest" | ||
"testing" | ||
|
||
"github.com/gin-gonic/gin" | ||
"github.com/nicelizhi/easy-admin/app/admin/apis" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func HomepageHandler(c *gin.Context) { | ||
c.JSON(http.StatusOK, gin.H{"message": "Welcome golang"}) | ||
} | ||
|
||
func SetUpRouter() *gin.Engine { | ||
gin.SetMode(gin.TestMode) | ||
router := gin.Default() | ||
fmt.Println(router.Routes()) | ||
return router | ||
} | ||
func TestHomepageHandler(t *testing.T) { | ||
// mockResponse := `{"message":"Welcome goland"}` | ||
r := SetUpRouter() | ||
r.GET("/", apis.EasyAdminStart) | ||
req, _ := http.NewRequest("GET", "/", nil) | ||
w := httptest.NewRecorder() | ||
r.ServeHTTP(w, req) | ||
// responseData, _ := ioutil.ReadAll(w.Body) | ||
// assert.Equal(t, mockResponse, string(responseData)) | ||
assert.Equal(t, http.StatusOK, w.Code) | ||
} | ||
|
||
func TestUserLoginHandler(t *testing.T) { | ||
// r := SetUpRouter() | ||
// r.GET("/api/v1/getinfo", apis.SysUser.GetInfo) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.