Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
testsla committed Sep 30, 2018
1 parent 51cdf43 commit dd984b7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ node_modules/
build/
tmp/
temp/
.ormconfig.json
ormconfig.json
4 changes: 2 additions & 2 deletions ormconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"type": "mysql",
"host": "localhost",
"host": "47.91.228.137",
"port": 3306,
"username": "root",
"password": "root",
"database": "apijson",
"database": "test",
"synchronize": true,
"logging": false,
"entities": [
Expand Down
2 changes: 1 addition & 1 deletion src/entity/Message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Entity, PrimaryGeneratedColumn, Column, BaseEntity, ManyToOne, JoinColu
import { User } from "./User";
@Entity()
export class Message extends BaseEntity {
@PrimaryGeneratedColumn()
@PrimaryGeneratedColumn('uuid')
id: number;
@Column({
comment:'用户内容'
Expand Down
7 changes: 5 additions & 2 deletions src/entity/User.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Entity, PrimaryGeneratedColumn, Column, BaseEntity, OneToMany } from "typeorm";
import { Entity, PrimaryGeneratedColumn, Column, BaseEntity, OneToMany, CreateDateColumn } from "typeorm";
import { validate, Contains, IsInt, Length, IsEmail, IsFQDN, IsDate, Min, Max, IsString, IsIn, IsEnum } from "class-validator";
import { Message } from "./Message";
@Entity()
export class User extends BaseEntity {
@IsInt()
@PrimaryGeneratedColumn()
@PrimaryGeneratedColumn('uuid')
id: number;

@CreateDateColumn()
created:Date;

@IsString()
@Column({
comment:'用户英文名'
Expand Down
7 changes: 7 additions & 0 deletions src/test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var crypto = require('crypto')
var getSign = 'absdafdgs80943h()*)&()#c'
var md5 = crypto.createHash('md5')
let _update = md5.update(getSign)
let _dis = md5.digest('hex')
console.log(_update)
console.log(_dis)

0 comments on commit dd984b7

Please sign in to comment.