Both of those greetings are common, singleman. Once you and the class know each other, then you can improvise a little. You will know the people in the class, I presume, and you can begin to adjust your greetings to suit the students who come to that class.
"Good morning class!"/"Good afternoon class!" is the way our teachers would address us when I was in Primary and High School in the fifties and sixties. "Hi class!" wasn't something I ever heard, but things may have changed. "Good morning everyone!"/"Good afternoon everyone!" would also work.